• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to connect a reomte jms server  RSS feed

 
mmccrr mmccrr
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my code is works well if jms server is localhost,but if i want to connect a remote jms server(such as ip:10.240.4.100),exception will happens.What should i do? or any configuration should i change?

my code is following:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
url = "corbaloc:iiop:localhost:2809";
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_PRINCIPAL,"cehs");
env.put(Context.SECURITY_CREDENTIALS, "cehs");
Context ctx = new InitialContext(env);
String strQueueConnFactName = "jms/MessagingConnectionFactory";
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup(strQueueConnFactName);
connection = factory.createQueueConnection();
session = connection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
..............
if i change the url to "corbaloc:iiop:10.240.4.100:2809"
the exception occured:
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for '10.240.4.100:WAS_10_240_4_100_server1'

what should i do?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!