• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communicating with JMS queue in Different Domain on same machine

 
Priya Dorairaj
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I get this following exception on trying to send message to a JMS queue which is configured on a different domain ,but residing on the same machine from which i'm sending the message .
This is the client which sends the JMS message
try {
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://216.89.196.169:6001" );
Context ic = new InitialContext(ht);
QueueConnectionFactory factory = (QueueConnectionFactory) ic.lookup(connFactory);
Queue queue = (Queue) ic.lookup("QueueName")
QueueConnection connect = factory.createQueueConnection();
logger.info("Queue connection is created");
QueueSession session = connect.createQueueSession(true,Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
TextMessage msg = session.createTextMessage(ackDoc.toString());
sender.send((Message) msg);
logger.info("Ack is placed in the Queue");
connect.close();
logger.info("Queue connection is closed");
return true;
} catch(JMSException jmse) {
logger.error(SDASMessages.JMS_EXCEPTION, (Throwable) jmse);
return false;
} catch (NamingException ne) {
logger.error(SDASMessages.NAMING_EXCEPTION, (Throwable) ne);
return false;
} catch(NullPointerException npe) {
logger.error(SDASMessages.NULL_EXCEPTION, (Throwable) npe);
return false;
}
}



weblogic.jms.common.JMSException: Connection not found
at weblogic.jms.dispatcher.InvocableManager.invocableFind(InvocableManager.java:136)
at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.java:608)
at weblogic.jms.dispatcher.DispatcherImpl.dispatchSync(DispatcherImpl.java:153)
at weblogic.jms.client.JMSConnection.createSessionInternal(JMSConnection.java:400)
at weblogic.jms.client.JMSConnection.createQueueSession(JMSConnection.java:347)

Is this the right approach to communicate with queue in differnt domain but in same machine?
please let me know ur suggestions.
Thanks In Advance
Sri
 
ankush purwar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can do it.
It means there are two servers running on same machine with different ports.
Make sure you are using the right port and configured JMS servers properly.
 
sripriya Ranganathan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks,
It is working!!
Sri
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic