Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Communicating with JMS queue in Different Domain on same machine

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks,
It is working!!
Sri
 
reply
    Bookmark Topic Watch Topic
  • New Topic