Troubleshooting
Problem
Using UM 10.1 Fix 6 at server side and client using JMS standard libraries sending an event to a Queue where the user is not authorized to publish (ACL without push).
The Java client finish without showing any error or exception on the ACL, the authorization ERROR is shown in UM server side:
[Wed Jul 25 10:32:50 CEST 2018] [ReadPool:118] [com.pcbsys.nirvana.server] - SECURITY: No privilege for attempted operation:xxx@xxx Operation : Publish <Test_External_Queue>
But the client do not shows any error, and the event is not published.
The code is like:
1) MessagingClient.java
SimpleMessageProducer sender = new SimpleMessageProducer();
sender.sendToQueue(CFName, QueueName, sslEnabled, userName, password, sendData);
2) SimpleMessageProducer.java
public void sendToQueue(String CFName, String QueueName, boolean sslEnabled, String userName, String password, String data){
try{
//get connection factory
messaging = new InitialContext();
logger.trace("connected to InitialContext");
connectionFactory = (ConnectionFactory) messaging.lookup(CFName);
logger.trace("connection factory loaded");
//get a destination
queue = (Queue) messaging.lookup(QueueName);
logger.trace("destination loaded");
messaging.close();
logger.trace("connection closed");
//create connection
if (sslEnabled) {
connection = connectionFactory.createConnection(userName, password);
} else {
connection = connectionFactory.createConnection();
}
logger.trace("connection created");
//create session
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
System.out.println("----------------This is the client ID:" + connection.getClientID());
logger.trace("session created");
//create message producer
sender = session.createProducer(queue);
logger.trace("message producer created");
//start message delivery
connection.start();
logger.trace("connection started");
//using a text message
TextMessage message = session.createTextMessage(data);
sender.send(message);
logger.info("message sent");
}
catch(Exception e){
logger.error("Could not send message to queue");
System.out.println(e);
} finally {
if (connection != null) {
try {
connection.close();
logger.trace("connection closed");
} catch (JMSException e) {
e.printStackTrace();
System.out.println(e);
}
}
}
}
Document Location
Worldwide
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
20 March 2025
UID
ibm17211855