Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to run JMS client  RSS feed

faisal khan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to run simple JMS client to send messages and get Messages.
but there is exception given below,
Exception: Cannot authenticate user
public QSender ("ConnectionFactory","queue/testQueue") {
try {
qFactory = (QueueConnectionFactory)context.lookup (factory);
qConnection = qFactory.createQueueConnection();
qSession = qConnection.createQueueSession (false,Session.AUTO_ACKNOWLEDGE);
queue = (Queue) context.lookup (destination);
qSender = qSession.createSender (queue);
public void sendMessage(String message) {
try {
TextMessage tm = qSession.createTextMessage (message);
qSender.send (tm);
}catch(JMSException jmse) {
System.out.println("Error in sendMessage() \n"+jmse);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!