【问题标题】:Camel The application attempted to use a JMS session after it had closed the sessionCamel 应用程序在关闭会话后尝试使用 JMS 会话
【发布时间】:2017-06-22 20:08:30
【问题描述】:

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

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

<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>

它是一个简单的应用程序,试图确定我缺少什么。

【问题讨论】:

    标签: jboss apache-camel activemq ibm-mq


    【解决方案1】:

    我发现了这个 JBossDeveloper 错误“JBEAP-2344: UserTransaction commit(), rollback() closes connection in Websphere MQ 7.5”,看起来它描述了您的问题,并且 cmets 指向文档更新“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.

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多