连接远程 JBoss-eap-6.2 以在 java 中传递消息
Connecting remote JBoss-eap-6.2 to pass message in java
代码运行没有任何问题,直到创建连接工厂,但它无法创建主题连接。创建主题连接时会抛出以下异常。(我的代码用于创建发布者和订阅者)
这是我收到的终端输出,
Jun 03, 2015 10:51:55 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA-redhat-1
Jun 03, 2015 10:51:55 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA-redhat-1
Jun 03, 2015 10:51:55 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.18.GA-redhat-1
connFactory : HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initial
Connectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting
-impl-netty-NettyConnectorFactory) ?host=172-26-75-72&port=5545], discoveryGroup
Configuration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSiz
e=1048576, readOnly=false]
JMSException
javax.jms.JMSException: Failed to create session factory
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInter
nal(HornetQConnectionFactory.java:587)
at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection
(HornetQConnectionFactory.java:131)
at pubsub.Publisher.ConnectionSetup(Publisher.java:55)
at pubsub.Publisher.sendMessage(Publisher.java:77)
at pubsub.PubStart.main(PubStart.java:9)
Caused by: HornetQException[errorType=NOT_CONNECTED message=HQ119007: Cannot con
nect to server(s). Tried with all available servers.]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(S
erverLocatorImpl.java:909)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInter
nal(HornetQConnectionFactory.java:583)
... 4 more
Jun 03, 2015 10:51:57 AM org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1
$MessageReceiver handleEnd
ERROR: Channel end notification received, closing channel Channel ID 9ebab472 (o
utbound) of Remoting connection 01bb14d2 to /172.26.75.72:4547
由于我是通过 VPN 连接访问这个 Jboss 服务器,他们只允许我访问 172.26.75.72:4547 only.The 端口是 4547 因为他们被设置为 100 的偏移量在独立-full.xml 文件中。
打印连接工厂后,我看到它访问另一个端口进行通信,因为它们不允许该端口访问我的代码抛出异常。除非您在不受限制的网络中工作,否则不会抛出上述异常。允许端口 4547 后我的代码 运行 顺利。
代码运行没有任何问题,直到创建连接工厂,但它无法创建主题连接。创建主题连接时会抛出以下异常。(我的代码用于创建发布者和订阅者) 这是我收到的终端输出,
Jun 03, 2015 10:51:55 AM org.xnio.Xnio <clinit>
INFO: XNIO Version 3.0.7.GA-redhat-1
Jun 03, 2015 10:51:55 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.0.7.GA-redhat-1
Jun 03, 2015 10:51:55 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.18.GA-redhat-1
connFactory : HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initial
Connectors=[TransportConfiguration(name=netty, factory=org-hornetq-core-remoting
-impl-netty-NettyConnectorFactory) ?host=172-26-75-72&port=5545], discoveryGroup
Configuration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSiz
e=1048576, readOnly=false]
JMSException
javax.jms.JMSException: Failed to create session factory
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInter
nal(HornetQConnectionFactory.java:587)
at org.hornetq.jms.client.HornetQConnectionFactory.createTopicConnection
(HornetQConnectionFactory.java:131)
at pubsub.Publisher.ConnectionSetup(Publisher.java:55)
at pubsub.Publisher.sendMessage(Publisher.java:77)
at pubsub.PubStart.main(PubStart.java:9)
Caused by: HornetQException[errorType=NOT_CONNECTED message=HQ119007: Cannot con
nect to server(s). Tried with all available servers.]
at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(S
erverLocatorImpl.java:909)
at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInter
nal(HornetQConnectionFactory.java:583)
... 4 more
Jun 03, 2015 10:51:57 AM org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1
$MessageReceiver handleEnd
ERROR: Channel end notification received, closing channel Channel ID 9ebab472 (o
utbound) of Remoting connection 01bb14d2 to /172.26.75.72:4547
由于我是通过 VPN 连接访问这个 Jboss 服务器,他们只允许我访问 172.26.75.72:4547 only.The 端口是 4547 因为他们被设置为 100 的偏移量在独立-full.xml 文件中。 打印连接工厂后,我看到它访问另一个端口进行通信,因为它们不允许该端口访问我的代码抛出异常。除非您在不受限制的网络中工作,否则不会抛出上述异常。允许端口 4547 后我的代码 运行 顺利。