File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes BEA/Weblogic and the fly likes Communicating with JMS queue in Different Domain on same machine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Communicating with JMS queue in Different Domain on same machine" Watch "Communicating with JMS queue in Different Domain on same machine" New topic

Communicating with JMS queue in Different Domain on same machine

Priya Dorairaj

Joined: Dec 11, 2005
Posts: 1
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://" );
Context ic = new InitialContext(ht);
QueueConnectionFactory factory = (QueueConnectionFactory) ic.lookup(connFactory);
Queue queue = (Queue) ic.lookup("QueueName")
QueueConnection connect = factory.createQueueConnection();"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);"Ack is placed in the Queue");
connect.close();"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(
at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(
at weblogic.jms.dispatcher.DispatcherImpl.dispatchSync(
at weblogic.jms.client.JMSConnection.createSessionInternal(
at weblogic.jms.client.JMSConnection.createQueueSession(

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
ankush purwar
Ranch Hand

Joined: Sep 02, 2005
Posts: 46
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

Joined: Jun 27, 2005
Posts: 7
It is working!!
I agree. Here's the link:
subject: Communicating with JMS queue in Different Domain on same machine
It's not a secret anymore!