【发布时间】:2019-01-08 19:42:11
【问题描述】:
我制作了一个 jar 来连接到 JMS 提供程序,它在服务器 (a) 上可以正常工作,但在服务器 (b) 上无法正常工作。
我验证通过 telnet 从服务器 (b) 到 JMS 提供程序的连接正常,如下所示:
-> telnet -d 10.127.161.247 4447
Trying 10.127.161.247...
Connected to 10.127.161.247.
它抛出的日志和异常如下:
2018/08/01 11:19:47:921 - Processing command line arguments...
2018/08/01 11:19:47:927 - Preparing the output... Writing to file = true
2018/08/01 11:19:50:315 - Trying to establish connection, attempt: 0
2018/08/01 11:19:52:132 - Connecting to provider: remote://10.127.161.247:4447 using user: oad_user
2018/08/01 11:19:52:132 - Creating a regular (non-secure) connection factory...
2018/08/01 11:19:53:073 - Opening a connection to the JMS provider...
2018/08/01 11:20:24:192 - Attempt failed: Failed to create session factory
javax.jms.JMSException: Failed to create session factory
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:675)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createTopicConnection(ActiveMQConnectionFactory.java:267)
at com.alcatel.ossgw.client.jms.JmsSubscriberClient.prepareConnection(JmsSubscriberClient.java:334)
at com.alcatel.ossgw.client.jms.JmsSubscriberClient.connect(JmsSubscriberClient.java:274)
at com.alcatel.ossgw.client.jms.JmsSubscriberClient.listen(JmsSubscriberClient.java:97)
at com.alcatel.ossgw.client.jms.JmsSubscriberClient.main(JmsSubscriberClient.java:536)
Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ119007: Cannot connect to server(s). Tried with all available servers.]
at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:818)
at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:67
知道我是 JMS 的新手,我不知道如何调试这样的问题,我将不胜感激任何评论和想法..
非常感谢
【问题讨论】:
-
你用 telnet 做的测试来自服务器 b?
-
@losusovic 是的,telnet 来自服务器 b。
-
remote://10.127.161.247:4447 听起来很奇怪。它应该类似于 tcp://10.127.161.247:4447 - 我想。此外,即使您可以远程登录,您的 API 也可能需要与端口 4447 上的 ActiveMQ 代理提供的不同协议。
-
@AxelPodehl 感谢您的回答,但如果我从服务器 (a) 运行 jar,它就可以正常工作...
标签: java jboss jms spring-jms jms-topic