我有一个独立的Java客户端程序,该程序将消息发送到Websphere MQ系统上的队列。我想避免为每条消息创建新的连接,会话和生产者,因此我使用activemq-jms-pool软件包(v5.11.1)提供的连接池功能。
此连接池的设置如下:
this.fConnectionFactory = new PooledConnectionFactory();
((PooledConnectionFactory)this.fConnectionFactory).setConnectionFactory(mqConnectionFactory);
((PooledConnectionFactory)this.fConnectionFactory).setMaxConnections(1);
((PooledConnectionFactory)this.fConnectionFactory).setMaximumActiveSessionPerConnection(1);
((PooledConnectionFactory)this.fConnectionFactory).setExpiryTimeout(10 * 60 * 1000);
((PooledConnectionFactory)this.fConnectionFactory).setIdleTimeout(10 * 60 * 1000);
((PooledConnectionFactory)this.fConnectionFactory).setReconnectOnException(true);
((PooledConnectionFactory)this.fConnectionFactory).setCreateConnectionOnStartup(true);
我的MQ客户端本身是版本“ 7.5.0.5-p750-005-150424”。 Websphere MQ本身是版本8。
但是我有时会在日志中看到以下异常:
com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment$1: MQJMS2007: failed to send message to MQ queue.
at com.ibm.msg.client.wmq.v6.jms.internal.ConfigEnvironment.newException(ConfigEnvironment.java:379) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.sendInternal(MQMessageProducer.java:1218) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:2490) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.send(MQMessageProducer.java:2608) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.sendMessage(JmsMessageProducerImpl.java:927) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send_(JmsMessageProducerImpl.java:783) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.jms.internal.JmsMessageProducerImpl.send(JmsMessageProducerImpl.java:363) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.mq.jms.MQMessageProducer.send(MQMessageProducer.java:274) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at org.apache.activemq.jms.pool.PooledProducer.send(PooledProducer.java:95) ~[activemq-jms-pool-5.11.1.jar:5.11.1]
at org.apache.activemq.jms.pool.PooledProducer.send(PooledProducer.java:71) ~[activemq-jms-pool-5.11.1.jar:5.11.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102]
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:na]
Caused by: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2009'.
at com.ibm.msg.client.wmq.v6.base.internal.MQQueueManager.putMsg2(MQQueueManager.java:617) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageProducer.sendInternal(MQMessageProducer.java:1178) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
... 34 common frames omitted
08:37:05.989 [main] WARN o.a.activemq.jms.pool.PooledSession - Caught exception trying close() when putting session back into the pool, will invalidate. com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0020: This session is closed.
An application called a method that must not be used after the session is closed.
Ensure that the session is not closed before calling the method.
com.ibm.msg.client.jms.DetailedIllegalStateException: JMSCC0020: This session is closed.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_102]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_102]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_102]
at com.ibm.msg.client.commonservices.j2se.NLSServices.createException(NLSServices.java:319) ~[com.ibm.mq.jmqi.jar:7.5.0.8 - p750-008-170628]
at com.ibm.msg.client.commonservices.nls.NLSServices.createException(NLSServices.java:233) ~[com.ibm.mq.jmqi.jar:7.5.0.8 - p750-008-170628]
at com.ibm.msg.client.jms.internal.JmsErrorUtils.createException(JmsErrorUtils.java:109) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.jms.internal.State.checkNotClosed(State.java:150) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.jms.internal.JmsSessionImpl.checkNotClosed(JmsSessionImpl.java:2526) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.msg.client.jms.internal.JmsSessionImpl.setMessageListener(JmsSessionImpl.java:1730) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at com.ibm.mq.jms.MQSession.setMessageListener(MQSession.java:1004) ~[com.ibm.mqjms-7.5.0.5.jar:7.5.0.5 - p750-005-150424]
at org.apache.activemq.jms.pool.PooledSession.close(PooledSession.java:103) ~[activemq-jms-pool-5.11.1.jar:5.11.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_102]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_102]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_102]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_102]
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-4.12.jar:4.12]
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.12.jar:4.12]
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-4.12.jar:4.12]
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-4.12.jar:4.12]
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-4.12.jar:4.12]
at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-4.12.jar:4.12]
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) [.cp/:na]
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) [.cp/:na]
是什么原因导致此错误(以及如何避免)? 没有网络问题,并且两者之间也没有防火墙。在发送不同消息之间有一段时间(例如5分钟左右)时,似乎会出现此问题。
谢谢。
编辑06/12/2018:添加了其他例外
20181204 164448.873 [INFO ] b.g.s.c.j.s.CachingConnectionFactory - Encountered a JMSException - resetting the underlying JMS Connection
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ1107: A problem with this connection has occurred.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:585) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.internal.WMQConnection.consumer(WMQConnection.java:785) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.api.RemoteHconn.callEventHandler(RemoteHconn.java:2621) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.api.RemoteHconn.driveEventsEH(RemoteHconn.java:601) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.processHconn(RemoteDispatchThread.java:668) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteDispatchThread.run(RemoteDispatchThread.java:244) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:214) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:105) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:229) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:303) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1241) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
... 10 common frames omitted
20181204 164448.873 [TRACE] b.g.s.c.j.s.CachingConnectionFactory - Reset connection, first close cached sessions (active: false).
20181204 164448.874 [TRACE] b.g.s.c.j.s.CachingConnectionFactory - Invoking method close via proxied session handler.
20181204 164448.874 [DEBUG] b.g.s.c.j.s.CachingConnectionFactory - Physically closing cached Session: com.ibm.mq.jms.MQQueueSession@4bb27555
20181204 164448.874 [TRACE] b.g.s.c.j.s.CachingConnectionFactory - Closing producer com.ibm.mq.jms.MQQueueSender@1aad157c
20181204 164448.878 [TRACE] b.g.s.c.j.s.CachingConnectionFactory - Could not close cached JMS Session
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0019: Failed to disconnect from queue manager 'xx' using connection mode '1' and host name 'xxx(1446)'.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:585) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.internal.WMQSession.disconnect(WMQSession.java:712) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.internal.WMQSession.close(WMQSession.java:663) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:513) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.jms.internal.JmsSessionImpl.close(JmsSessionImpl.java:303) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jms.MQSession.close(MQSession.java:298) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at xxx.server.comm.jms.spring.CachingConnectionFactory$CachedSessionInvocationHandler.physicalClose(CachingConnectionFactory.java:567) ~[xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:356) ~[xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at com.sun.proxy.$Proxy124.close(Unknown Source) ~[na:na]
at xxx.server.comm.jms.spring.CachingConnectionFactory.resetConnection(CachingConnectionFactory.java:200) ~[xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.SingleConnectionFactory.onException(SingleConnectionFactory.java:387) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.SingleConnectionFactory$AggregatedExceptionListener.onException(SingleConnectionFactory.java:832) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at com.ibm.msg.client.jms.internal.JmsProviderExceptionListener.run(JmsProviderExceptionListener.java:427) [com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:214) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:105) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:229) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:303) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1241) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
... 17 common frames omitted
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
at com.ibm.mq.jmqi.remote.impl.RemoteSession.getConnection(RemoteSession.java:509) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteSession.allocateMQAPI(RemoteSession.java:1375) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteSession.allocateMQAPI(RemoteSession.java:1345) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.api.RemoteFAP.MQDISC(RemoteFAP.java:2741) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.MQDISC(InterceptedJmqiImpl.java:335) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.ese.jmqi.ESEJMQI.MQDISC(ESEJMQI.java:237) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.internal.WMQSession.disconnect(WMQSession.java:693) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
... 16 common frames omitted
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from host 'xxx/xxx (xxx)'. [1=-1,2=ffffffff,3=xxx/ (xxx),4=TCP]
at com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.receiveBuffer(RemoteRcvThread.java:821) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:757) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.run(RemoteRcvThread.java:150) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
... 5 common frames omitted
20181204 164448.878 [DEBUG] b.g.s.c.j.s.CachingConnectionFactory - Closing shared JMS Connection: com.ibm.mq.jms.MQQueueConnection@3bbfe008
20181204 164448.879 [DEBUG] b.g.s.c.j.s.CachingConnectionFactory - Could not close shared JMS Connection
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0019: Failed to disconnect from queue manager 'TM01' using connection mode '1' and host name 'xxx'.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:585) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.internal.WMQConnection.close(WMQConnection.java:709) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.jms.internal.JmsConnectionImpl.close(JmsConnectionImpl.java:347) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jms.MQConnection.close(MQConnection.java:98) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at xxx.server.comm.jms.spring.SingleConnectionFactory.closeConnection(SingleConnectionFactory.java:546) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.SingleConnectionFactory.resetConnection(SingleConnectionFactory.java:413) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.CachingConnectionFactory.resetConnection(CachingConnectionFactory.java:213) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.SingleConnectionFactory.onException(SingleConnectionFactory.java:387) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at xxx.server.comm.jms.spring.SingleConnectionFactory$AggregatedExceptionListener.onException(SingleConnectionFactory.java:832) [xxx.server.comm.jms_18.63.7.SNAPSHOT.jar:na]
at com.ibm.msg.client.jms.internal.JmsProviderExceptionListener.run(JmsProviderExceptionListener.java:427) [com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:214) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:105) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:229) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:303) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1241) [com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
... 14 common frames omitted
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
at com.ibm.mq.jmqi.remote.impl.RemoteSession.getConnection(RemoteSession.java:509) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteSession.allocateMQAPI(RemoteSession.java:1375) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteSession.allocateMQAPI(RemoteSession.java:1345) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.api.RemoteFAP.MQDISC(RemoteFAP.java:2741) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.ese.jmqi.InterceptedJmqiImpl.MQDISC(InterceptedJmqiImpl.java:335) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.ese.jmqi.ESEJMQI.MQDISC(ESEJMQI.java:237) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.msg.client.wmq.internal.WMQConnection.close(WMQConnection.java:692) ~[com.ibm.mqjms.jar:7.5.0.7 - p750-007-160812]
... 13 common frames omitted
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from host 'xxx'. [1=-1,2=ffffffff,3=xxx,4=TCP]
at com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.receiveBuffer(RemoteRcvThread.java:821) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:757) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
at com.ibm.mq.jmqi.remote.impl.RemoteRcvThread.run(RemoteRcvThread.java:150) ~[com.ibm.mq.jmqi.jar:7.5.0.7 - p750-007-160812]
... 5 common frames omitted
答案 0 :(得分:0)
问题的根本原因是以下链接的异常
MQJE001:完成代码“ 2”,原因为“ 2009”。
这意味着底层TCP / IP连接已在消息传递客户端/服务器下关闭。通常,当缺少活动导致防火墙关闭连接时,就会发生此问题。
要解决此问题,只需更改导致连接关闭的防火墙规则。