activemq 无法获取消息

前几天linux系统上写个消费activemq消息的java程序时遇到这个错误,原因是linux系统的activemq客户端hostname引起,把hostname改为localhost可以决绝。但具体原因不是很明白。

 

下面提示中:BFG-OSER-273是访问activemq的客户端的hostname;


WARNING: could not generate unique stub
java.net.UnknownHostException: BFG-OSER-273: BFG-OSER-273
        at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
        at org.apache.activemq.util.IdGenerator.<clinit>(IdGenerator.java:51)
        at org.apache.activemq.ActiveMQConnection.<clinit>(ActiveMQConnection.java:108)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:285)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:253)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:224)
        at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:172)
        at com.baofeng.activemqmonitor.consumer.AbstractConsumer.start(AbstractConsumer.java:67)
        at com.baofeng.activemqmonitor.MainClass.main(MainClass.java:34)
Aug 18, 2010 7:31:54 PM org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to tcp://60.28.110.228:61616
javax.jms.JMSException: broker Cannot add a consumer to a session that had not been registered: ID:null0:0:-1
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1244)
        at org.apache.activemq.AdvisoryConsumer.<init>(AdvisoryConsumer.java:50)
        at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1348)
        at org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:298)
        at com.baofeng.activemqmonitor.consumer.AbstractConsumer.start(AbstractConsumer.java:68)
        at com.baofeng.activemqmonitor.MainClass.main(MainClass.java:34)
Caused by: java.lang.IllegalStateException: broker Cannot add a consumer to a session that had not been registered: ID:null0:0:-1
        at org.apache.activemq.broker.TransportConnection.processAddConsumer(TransportConnection.java:535)
        at org.apache.activemq.command.ConsumerInfo.visit(ConsumerInfo.java:345)
        at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:305)
        at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:179)
        at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:143)
        at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:206)
        at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203)
        at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
        at java.lang.Thread.run(Thread.java:619)
Aug 18, 2010 7:31:54 PM org.apache.activemq.transport.failover.FailoverTransport handleTransportFailure
WARNING: Transport failed to tcp://60.28.110.228:61616 , attempting to automatically reconnect due to: java.io.EOFException

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值