骆驼应用程序在关闭会话后尝试使用JMS会话 [英] Camel The application attempted to use a JMS session after it had closed the session

查看:133
本文介绍了骆驼应用程序在关闭会话后尝试使用JMS会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是骆驼的新手,我正在尝试编写一个在JBoss EAP 7上架起Websphere MQ和Active MQ桥梁的应用程序.该应用程序部署成功,我可以将消息拖放到Websphere队列上,并且被Active拾取. MQ.但是,我在日志中看到错误消息,显示它在打开后正在尝试使用连接.

I am new to camel and I am attempting to write an app that bridges Websphere MQ and Active MQ on JBoss EAP 7. The app deploys successfully works, I can drop messages on the Websphere queue, and it gets picked up by Active MQ. However I see error messages in the log showing it is attempting to use a connection after it is open.

15:48:57,814 ERROR [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (Camel (camel) thread #1 - JmsConsumer[I0_TEST]) IJ000315: Pool IbmMQQueueFactory has 1 active handles
15:48:57,819 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (Camel (camel) thread #1 - JmsConsumer[I0_TEST]) wmq.jmsra.rar: MQJCA4016:Unregistered connection handle being closed: 'com.ibm.mq.connector.outbound.ConnectionWrapper@214da401'.
15:49:02,819 WARN  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (Camel (camel) thread #1 - JmsConsumer[I0_TEST]) Setup of JMS message listener invoker failed for destination 'I0_TEST' - trying to recover. Cause: Local JMS transaction failed to commit; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1020: The session is closed.
The application attempted to use a JMS session after it had closed the session.
Modify the application so that it closes the JMS session only after it has finished using the session.

这是我的applicationContext.xml

Here is my applicationContext.xml

<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:/ConnectionFactory" />
    <property name="lookupOnStartup" value="false" />
    <property name="cache" value="true" />
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>

<bean id="jmsTransactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManagerName" value="java:/TransactionManager" />
</bean>

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="transacted" value="true" />
    <property name="transactionManager" ref="jmsTransactionManager" />
</bean>

<bean id="wmqConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:/jms/IbmMQMsgQCF" />
    <property name="lookupOnStartup" value="false" />
    <property name="cache" value="true" />
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>

<bean id="wmqTransactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManagerName" value="java:/TransactionManager" />
</bean>

<bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="wmqConnectionFactory" />
    <property name="transacted" value="true" />
    <property name="transactionManager" ref="wmqTransactionManager" />
</bean>


<bean id="routerlogger" class="org.jboss.as.quickstarts.mdb.RoutLogger" />

<camelContext trace="true" id="camel"
    xmlns="http://camel.apache.org/schema/spring">

    <route>
        <from uri="wmq:websphereQueue"/>
        <setExchangePattern pattern="InOnly"/>
        <to uri="jms:activeQueue" pattern="InOnly" />
    </route>
</camelContext>

它是一个简单的应用程序,试图确定我所缺少的内容.

Its a simple app, trying to determine what I'm missing.

推荐答案

我发现了这个JBossDeveloper错误" JBEAP-2344:UserTransaction commit(),rollback()关闭Websphere MQ 7.5中的连接",它似乎描述了您的问题,并带有指向文档更新"

I found this JBossDeveloper bug "JBEAP-2344: UserTransaction commit(), rollback() closes connection in Websphere MQ 7.5" which looks like it describes your issue and has comments pointing to documentation update "JBEAP-3535: Documentation: Add note about connection close on commit() and rollback() to Deploy the WebSphere MQ Resource Adapter subchapter".

能否请您添加一条注释,说明设置tracking="false"可以解决 WebSphere MQ 7.5和8的问题,其中方法commit()或 UserTransaction上的rollback()关闭了以前的任何JMS连接 此交易的一部分.这部分与已知文件有关 WebSphere MQ的局限性 JBEAP-3142 .

Could you please add a note, that setting tracking="false", solves problem with WebSphere MQ 7.5 and 8, where method commit() or rollback() on UserTransaction closes any JMS connections which was part of this transaction. This part is related to documenting known limitation of WebSphere MQ in JBEAP-3142.

这篇关于骆驼应用程序在关闭会话后尝试使用JMS会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆