连接远程JBoss-eap-6.2以在java中传递消息

时间:2015-06-03 03:23:06

标签: java jboss jms hornetq

代码在创建连接工厂时没有任何问题,但无法创建主题连接。在创建主题连接时,它会抛出以下异常。(我的代码用于创建发布者和订阅者) 这是我收到的终端输出,

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

1 个答案:

答案 0 :(得分:0)

由于我通过VPN连接访问此Jboss服务器,因此只允许我访问172.26.75.72:4547。端口为4547,因为它们在standalone-full.xml文件中设置为100。 打印连接工厂后,我看到它访问另一个端口进行通信,因为它们不允许该端口访问我的代码抛出异常。直到您在不受限制的网络中工作,才会抛出上述异常。允许端口4547后,我的代码运行顺利。

相关问题