javax.jms.JMSException:通道长时间处于非活动状态:localhost / 127.0.0.1:7676

时间:2013-08-13 06:58:25

标签: connection jms activemq

我正在尝试使用独立的Java代码使用ActiveMQ连接jms服务器,但我正在努力应对以下异常。我尝试了各种选择,但无法找出根本原因。

以下代码行失败了, jmsConnection.start();

我的经纪人网址是,

tcp://localhost:7676?wireFormat.maxInactivityDuration=0

Stack Trace如下,

javax.jms.JMSException: Channel was inactive for too long: localhost/127.0.0.1:7676
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1206)
        at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1289)
        at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:456)
        at com.bt.ccdr.dbtoqueue.DBToQueueHelperImpl.getJMSConnection(DBToQueueHelperImpl.java:172)
        at com.bt.ccdr.dbtoqueue.DBToQueueHelperImpl.main(DBToQueueHelperImpl.java:42)
Caused by: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too long: localhost/127.0.0.1:7676
        at org.apache.activemq.transport.InactivityMonitor.oneway(InactivityMonitor.java:225)
        at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:83)
        at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:100)
        at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:40)
        at org.apache.activemq.transport.ResponseCorrelator.asyncRequest(ResponseCorrelator.java:74)
        at org.apache.activemq.transport.ResponseCorrelator.request(ResponseCorrelator.java:79)
        at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1195)
        ... 4 more

1 个答案:

答案 0 :(得分:2)

将连接sting更改为failover:(tcp://localhost:7676)failover transport层通过标准OpenWire tcp传输重新连接逻辑。