0 0

spring JMS webshpere MQ DefaultMessageListenerContainer 消息接收异常0

遇到过一个很棘手的springJMS异常,不知如何解决。在之前的测试中没发现,前几日出现一次,开启debug日志,在测试中出现了,现将异常贴出,寻对springJMS熟悉的人解决这个问题!

	<!-- MQ队列连接缓存工厂 -->
	<bean id="cachedConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory" >
		<property name="targetConnectionFactory" ref="ibmConnectionFactory" />
		<!-- http://blog.csdn.net/jeek566/article/details/8568500 -->
		<!--是否在连接抛出JMSException的时候,对连接进行重置,重置后如果再调用createConnection方法,那么会返回一个新的连接 -->
		<property name="reconnectOnException" value="true"/>
		<property name="sessionCacheSize" value="${mq.sessionCacheSize}" />
	</bean>
	<bean id="mqlistenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer" lazy-init="false"  >
		<property name="connectionFactory" ref="cachedConnectionFactory" />
		<property name="messageListener" ref="recieceQueueListener" />
		<property name="destination" ref="recieveQueue"/>
    	<property name="sessionTransacted" value="true"/>
		<property name="taskExecutor" ref="taskExecutor"/>
    	<property name="concurrentConsumers" value="${mq.listener.concurrentConsumers}"/>
    	<property name="maxConcurrentConsumers" value="${mq.listener.maxConcurrentConsumers}" />
    	<property name="idleTaskExecutionLimit" value="${mq.listener.idleTaskExecutionLimit}" />
	</bean>

异常信息:
22:11:49,652  WARN DefaultMessageListenerContainer:634 - Execution of JMS message listener failed
com.ibm.msg.client.jms.DetailedJMSException: JMSCMQ0002: The method 'MQCMIT' failed. A WebSphere MQ call failed. Please see the linked exception for more information.
	at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:599)
	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)
	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:258)
	at com.ibm.msg.client.wmq.internal.WMQSession.syncpoint(WMQSession.java:1378)
	at com.ibm.msg.client.wmq.internal.WMQSession.commit(WMQSession.java:627)
	at com.ibm.msg.client.jms.internal.JmsSessionImpl.commitTransaction(JmsSessionImpl.java:2283)
	at com.ibm.msg.client.jms.internal.JmsSessionImpl.commit(JmsSessionImpl.java:508)
	at com.ibm.mq.jms.MQSession.commit(MQSession.java:214)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:250)
	at $Proxy1.commit(Unknown Source)
	at org.springframework.jms.support.JmsUtils.commitIfNecessary(JmsUtils.java:217)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:546)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:449)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
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:206)
	... 21 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.receiveAsyncTsh(RemoteHconn.java:1930)
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.receiveTSH(RemoteHconn.java:1176)
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.receiveMQIFlow(RemoteHconn.java:1697)
	at com.ibm.mq.jmqi.remote.internal.RemoteFAP.MQCMIT(RemoteFAP.java:7190)
	at com.ibm.msg.client.wmq.internal.WMQSession.syncpoint(WMQSession.java:1348)
	... 19 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from host '/172.168.9.105:1414 (ACA80969.ipt.aol.com)'. [1=-1,2=ffffffff,3=/172.168.9.105:1414 (ACA80969.ipt.aol.com),4=TCP]
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveBuffer(RemoteRcvThread.java:648)
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:586)
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:141)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)
	at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298)
	at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220)
22:11:49,652 DEBUG TransactionSynchronizationManager:232 - Removed value [org.springframework.jms.listener.LocallyExposedJmsResourceHolder@7179290f] for key [org.springframework.jms.connection.CachingConnectionFactory@2392d604] from thread [taskExecutor-1]
22:11:49,689 DEBUG JmsUtils:154 - Could not close JMS MessageConsumer
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2000: Failed to close queue '02_1'. JMS attempted to close a WebSphere MQ destination, but encountered an error. The destination might already be closed, or another thread may be performing an MQGET while close() is called. Use the linked exception to determine the cause of this error. You may be able to perform the close() later.
	at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:599)
	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)
	at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.checkJmqiCallSuccess(WMQMessageConsumer.java:122)
	at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.close(WMQConsumerShadow.java:308)
	at com.ibm.msg.client.wmq.internal.WMQMessageConsumer.close(WMQMessageConsumer.java:369)
	at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.close(JmsMessageConsumerImpl.java:236)
	at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl.close(JmsMessageConsumerImpl.java:161)
	at com.ibm.mq.jms.MQQueueReceiver.close(MQQueueReceiver.java:80)
	at org.springframework.jms.support.JmsUtils.closeMessageConsumer(JmsUtils.java:151)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.clearResources(DefaultMessageListenerContainer.java:973)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:881)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
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:206)
	... 12 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:390)
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.enterCall(RemoteHconn.java:287)
	at com.ibm.mq.jmqi.remote.internal.RemoteFAP.MQCLOSE(RemoteFAP.java:5470)
	at com.ibm.msg.client.wmq.internal.WMQSyncConsumerShadow.closeInternal(WMQSyncConsumerShadow.java:379)
	at com.ibm.msg.client.wmq.internal.WMQConsumerShadow.close(WMQConsumerShadow.java:267)
	... 10 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from host '/172.168.9.105:1414 (ACA80969.ipt.aol.com)'. [1=-1,2=ffffffff,3=/172.168.9.105:1414 (ACA80969.ipt.aol.com),4=TCP]
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveBuffer(RemoteRcvThread.java:648)
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:586)
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:141)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)
	at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298)
	at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220)
22:11:49,690 DEBUG CachingConnectionFactory:214 - Returned cached Session: com.ibm.mq.jms.MQQueueSession@73d4d493
22:11:49,690  INFO DefaultMessageListenerContainer:742 - Setup of JMS message listener invoker failed - trying to recover
com.ibm.msg.client.jms.DetailedJMSException: JMSCMQ0002: The method 'MQCMIT' failed. A WebSphere MQ call failed. Please see the linked exception for more information.
	at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:599)
	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:219)
	at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:258)
	at com.ibm.msg.client.wmq.internal.WMQSession.syncpoint(WMQSession.java:1378)
	at com.ibm.msg.client.wmq.internal.WMQSession.commit(WMQSession.java:627)
	at com.ibm.msg.client.jms.internal.JmsSessionImpl.commitTransaction(JmsSessionImpl.java:2283)
	at com.ibm.msg.client.jms.internal.JmsSessionImpl.commit(JmsSessionImpl.java:508)
	at com.ibm.mq.jms.MQSession.commit(MQSession.java:214)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:250)
	at $Proxy1.commit(Unknown Source)
	at org.springframework.jms.support.JmsUtils.commitIfNecessary(JmsUtils.java:217)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:546)
	at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:449)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
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:206)
	... 21 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.receiveAsyncTsh(RemoteHconn.java:1930)
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.receiveTSH(RemoteHconn.java:1176)
	at com.ibm.mq.jmqi.remote.internal.RemoteHconn.receiveMQIFlow(RemoteHconn.java:1697)
	at com.ibm.mq.jmqi.remote.internal.RemoteFAP.MQCMIT(RemoteFAP.java:7190)
	at com.ibm.msg.client.wmq.internal.WMQSession.syncpoint(WMQSession.java:1348)
	... 19 more
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9208: Error on receive from host '/172.168.9.105:1414 (ACA80969.ipt.aol.com)'. [1=-1,2=ffffffff,3=/172.168.9.105:1414 (ACA80969.ipt.aol.com),4=TCP]
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveBuffer(RemoteRcvThread.java:648)
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.receiveOneTSH(RemoteRcvThread.java:586)
	at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:141)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209)
	at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224)
	at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298)
	at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220)


问题补充:出现此异常后,spring DefaultMessageListenerContainer停止接收队列中的消息了!
目前还没有答案

相关推荐

    WebShpere MQ 配置与测试

    IBM WebSphere MQ(简称WMQ或MQ)是一款企业级的消息中间件产品,它能够实现应用程序之间安全可靠的异步消息传递。无论应用程序是否同时处于运行状态,WebSphere MQ都能够确保消息能够被可靠地传递。在分布式计算...

    WebShpere MQ Java Interface日文版

    - **发送端与接收端Bean**:包括发送消息并接收响应的发送端Bean(Sender Bean),以及接收消息并发送响应的接收端Bean(Receiver Bean)。 - **简化设置**:为开发者隐藏了消息传递(JMS)的具体细节,简化了开发流程。 ...

    webshpere mq 7 教程

    - 广播通信:单个消息发送给多个接收者。 **1.3 WebSphere MQ的原理** WMQ基于发布/订阅和队列模型,通过消息队列实现点对点或一对多的消息传递。它采用非阻塞I/O和缓冲机制,确保高吞吐量和低延迟。 **1.4 ...

    Java下操作IBM Websphere MQ的项目案例

    5. **发送和接收消息**:使用`MQQueue`对象的`put()`和`get()`方法发送和接收消息。消息通常是`MQMessage`对象,可以携带二进制数据或文本。 6. **JNDI(Java Naming and Directory Interface)**:在更复杂的应用...

    WebShpere MQ 运行故障的定位分析和排除

    - **检查MQ配置**:确认消息传递的最大尝试次数和超时设置正确。 - **启用Trace功能**:在难以定位问题时,启用Trace功能可以提供更多细节。 #### 五、高级故障诊断工具 除了错误日志之外,MQ还提供了其他几种高级...

    如何进行WebShpere MQ 运行故障的定位分析和排除.doc

    WebSphere MQ,也被称为MQSeries,是IBM提供的一款强大的消息中间件产品,它允许应用程序在分布式环境中进行可靠的、异步的数据通信。随着其在中国的广泛应用,用户对性能优化和故障处理的需求日益增加。本文主要...

    Websphere MQ using C++

    IBM WebSphere MQ 是一个消息中间件产品,它能够帮助应用程序在分布式环境中可靠地发送和接收消息。通过使用 WebSphere MQ,开发人员可以构建出高度可扩展且健壮的应用程序。本文章基于 WebSphere MQ C++ 应用接口 ...

    WebSphere MQ7.0配置与测试(java 源码,含图)

    在本文中,我们将深入探讨如何在WebSphere MQ 7.0版本中进行配置和测试,以及如何通过Java源码实现消息的发送和接收。 首先,我们需要在发送方机器上进行以下配置: 1. 创建一个队列管理器,例如名为"Send",并...

    WebSphere MQ V7.0 jar

    WebSphere_MQ_V7.0.1.3 安装目录下\java\doc;\java\lib;\java\lib64. 包含com.ibm.mq.jar,com.ibm.mq.jmqi.jar,com.ibm.mq.axis2.jar,com.ibm.mq.commonservices.jar等等

    webshpere配置JMS

    JMS是一种标准API,用于在分布式环境中发送和接收消息,它提供了可靠的异步通信机制。WebSphere,特别是WebSphere Process Server和WebSphere Enterprise Service Bus,支持SOAP over JMS协议,允许Web服务通过JMS...

    MQ.zip_MQ_c++ mq

    6. **接收消息**:理解`MQGET`函数的用法,用于从队列中取出消息。可能需要处理不同类型的接收模式,如同步点、非阻塞等。 7. **错误处理**:在与MQ交互时,必须正确处理可能出现的错误,例如队列不存在、网络问题...

    MQ 运行故障的定位分析和排除

    如何进行WebShpere MQ 运行故障的定位分析和排除

    camel-wmq-amq:Camel IBM Websphere MQ 到 Active MQ 桥接路由

    骆驼-wmq-amq Camel IBM Websphere MQ 到 Active MQ 桥接路由 先决条件 IBM 为安装在 Fuse 上的 MQ ...部署路由后,使用 IBM MQ 查看器将测试消息发送到您的 IBM MQ 队列。 消息将由骆驼端点提取并传递到 AMQ 端点。

    MQ安装部署手册&配置&测试&常用命令

    MQ+for+Linux+安装配置手册.pdf mq安装手册1.doc WAS+6.1安装手册installation+guide.pdf WebShpere MQ 配置与测试.txt WebSphere MQ 常用命令.txt

    websphere MQ配置管理

    - **目标队列**: 实际接收消息的队列。 - **死信队列**(推荐): 用于存放无法正常处理的消息。 #### 四、具体操作步骤 假设使用两台Win2000环境(也可以使用XP)进行配置。 **1. 在源队列管理器(A机器)上的配置**...

    消息中间件及WebSphere MQ入门

    消息队列是消息中间件的一种常见实现方式,它允许应用程序将消息放入队列中,由消息中间件负责将这些消息路由到正确的接收方,即使接收方在发送消息时并未在线。 WebSphere MQ,也称为IBM MQ,是IBM提供的一款强大...

    MQ+配置与测试.doc

    - 编写测试程序MQTest.java,使用IBM提供的MQJava API与队列管理器建立连接,发送和接收消息。 - 运行测试程序,通过MQQueueManager、MQQueue、MQMessage和MQPutMessageOptions等类进行消息的写入和读取。 5. **...

    WEBSHPERE文档

    - **消息驱动**:不同于传统的面向过程或对象的交互模式,WebService采用消息传递机制,增强了系统的灵活性和可扩展性。 - **业界广泛接受**:超过160家公司的联盟支持,推动了WebService成为分布式计算领域的新标准...

    webshpere7.0.0.0 部署手册

    ### WebSphere 7.0.0.0 部署手册关键知识点解析 #### 一、概述 IBM WebSphere Application Server 7.0 (简称 WebSphere 7.0) 是一款功能强大的应用服务器,用于部署Java EE应用程序。该版本提供了许多新特性与改进...

Global site tag (gtag.js) - Google Analytics