简体   繁体   English

无法使用jms jndi建立连接

[英]Unable to establish connection using jms jndi

I am very new to JMS & JNDI, and I'm trying to receive message from a queue programatically, but I am not sure how I can connect to the server.我是 JMS 和 JNDI 的新手,我正在尝试以编程方式从队列接收消息,但我不确定如何连接到服务器。 I have Websphere console UI where I login to manage all my queues.我有 Websphere 控制台 UI,我可以在其中登录以管理我的所有队列。 This console UI is hosted at linux-server:7276 .此控制台 UI 托管在linux-server:7276 Below is the UI link下面是UI链接

https://my-server:9043/ibm/console

I have referred to the sample classes from IBM MQ JmsJndiConsumer :我参考了 IBM MQ JmsJndiConsumer中的示例类:

String contextFactory = "com.sun.jndi.ldap.LdapCtxFactory";
String initialContextUrl = "ldap://my-server:9043"
Hashtable<String, String> environment = new Hashtable<String, String>();
environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
environment.put(Context.PROVIDER_URL, initialContextUrl);
environment.put(Context.SECURITY_PRINCIPAL, userName);
environment.put(Context.SECURITY_CREDENTIALS, password);     
InitialContext context = new InitialContext(environment);

It always throws an error in the context Connection or outbound has closed .它总是在上下文Connection or outbound has closed中抛出错误。

The queue I am trying to connect to has these details:我尝试连接的队列具有以下详细信息:

Connection factories : jms/atConnectionFactory
queue-manager : appit-node.Sit-TBus
Bus name : TBus
queue name : jms/appitone-event
Bootstrap Member : linux-server:7276

You're using my-server:9043 for both your HTTPS and LDAP server.您正在为HTTPS和 LDAP 服务器使用my-server:9043 Both of these can't be using the same port on the same machine so one of them must be wrong which is almost certainly why it's failing.这两个不能在同一台机器上使用相同的端口,所以其中一个一定是错误的,这几乎可以肯定是它失败的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM