MQJMS2005异常未能创建MQQueueManager
在我的 GetJMSMessage 中,我使用了这个:
MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
cf.setPort(port);
cf.setHostName(host);
cf.setChannel(channel);
cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
cf.setQueueManager(queuemanager);
conn = (MQQueueConnection)cf.createQueueConnection();
当我将我的类作为独立应用程序运行时,这会起作用。但是,当我在 Weblogic 10 中部署项目时,它给出了 JMSException 错误。 IBM MQ 是远程部署的,我无法访问它。
错误堆栈跟踪是 javax.jms.JMSException:
MQJMS2005: failed to create MQQueueManager for 'hostname:queuemanager'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:644)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2567)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1912)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:161)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:202)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:121)
at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:1038)
是什么原因导致此错误以及如何修复此错误?为什么只有当我将项目部署到本地服务器时才会出现此错误?
In my GetJMSMessage, I used this:
MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
cf.setPort(port);
cf.setHostName(host);
cf.setChannel(channel);
cf.setTransportType(JMSC.MQJMS_TP_CLIENT_MQ_TCPIP);
cf.setQueueManager(queuemanager);
conn = (MQQueueConnection)cf.createQueueConnection();
This works when I run my class as a standalone app. However, when I deployed my project in Weblogic 10, it gave a JMSException error. IBM MQ is deployed remotely and I have no access to it.
The error stacktrace is javax.jms.JMSException:
MQJMS2005: failed to create MQQueueManager for 'hostname:queuemanager'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:644)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:2567)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:1912)
at com.ibm.mq.jms.MQQueueConnection.<init>(MQQueueConnection.java:161)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:202)
at com.ibm.mq.jms.MQQueueConnectionFactory.createQueueConnection(MQQueueConnectionFactory.java:121)
at com.ibm.mq.jms.MQQueueConnectionFactory.createConnection(MQQueueConnectionFactory.java:1038)
What causes this error and how can I fix this? and why does this error arises only when I deployed the project in my local server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当使用 JMS 并且您遇到异常但不知道原因时,您可能经常会在一个或多个链接的异常中找到更多信息,您可以通过如下所示的内容看到这些信息:
这些内部/链接的异常可能包含 MQ原因代码。
就您而言,它应该有望提供一些连接失败原因的线索。例如,队列管理器名称错误、队列管理器未运行、客户端内出现一些内部问题...
如果您找到更多信息,但仍在努力找出问题所在,请发布您找到的详细信息我可以尝试进一步提供建议。
When using JMS and you get an exception but don't know the cause, you might often find more information in one or more linked exceptions, which you can see with something like the following:
These inner/linked exceptions are likely to contain an MQ reason code.
In your case, it should hopefully give some clues to why the connection has failed. For example, the queue manager name is wrong, the queue manager is not running, some internal problem within the client...
If you find more info but you're still struggling to work out what is going wrong, post the details you find and I can try to advise further.