1

実行した手順:

  1. リンク http://www.atomikos.com/Documentation/Tomcat7Integration35に記載されているすべての手順に従いまし た。「atomikos-integration-extension-3.7.1-20120529.jar」を TOMCAT_HOME/lib フォルダーにコピーしました。

    b. サーバー.xml

    c. context.xml

    d. 必要なすべてのトランザクション jar を追加しました。また、トランザクション プロパティ:

  2. コードで行われた変更、

を。transaction.xml :

<bean id="UserTransactionBean"
    class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/UserTransaction"></property>
</bean>

<!--  One Bean that applies Transaction semantics as well as Retry Logic. It only supports
PROPOGATION_REQUIRED SEMANTICS.
-->
<bean id="TstTransactionInterceptor"
    class="com.test.transaction.interceptor.TstTransactionInterceptor">

    <property name="exceptionHandler" ref="TstRuntimeExceptionHandler" />

    <!--  Max Times to Retry a Transaction eligible for Retry -->
    <property name="maxRetryAttempts" value="1" />

    <!--  Time to wait between retries of eligible transactions ( in seconds)
    -->
    <property name="waitTimeBetweenRetries" value="2"></property>
    <property name="userTransaction" ref="UserTransactionBean" />

    <!--  List of methods that transaction interceptor will not apply declarative transactions for
    -->
    <property name="excludedMethodList">
        <list>
            <value>toString</value>
            <value>equals</value>
        </list>
    </property>
</bean>

<bean id="JTATxManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="autodetectTransactionManager" value="true" />
</bean>

<bean id="SpringTransactionInterceptor"
    class="org.springframework.transaction.interceptor.TransactionInterceptor">
    <property name="transactionManager">
        <ref bean="JTATxManager" />
    </property>
    <property name="transactionAttributeSource">
        <ref bean="TransactionAttributes" />
    </property>
</bean>

問題: メッセージをキューにプッシュしようとした場合にのみ、常に No JTA TransactionManager found がログに記録されます。DB 呼び出しを正常に実行できます。

-- checkUserTransactionAndTransactionManager, No JTA TransactionManager found: transaction suspension not available

-- WARNING: atomikos connection pool 'QCF_MQSeries_XA_RMI': error creating proxy of connection atomikos pooled connection for resource QCF_MQSeries_XA_RMI
    [3/28/14 14:26:25:052 CDT] 00000137 ConnectionPoo W com.atomikos.logging.JULLogger logWarning atomikos connection pool 'QCF_MQSeries_XA_RMI': error creating proxy of connection atomikos pooled connection for resource QCF_MQSeries_XA_RMI
                             com.atomikos.datasource.pool.CreateConnectionException: atomikos pooled connection for resource QCF_MQSeries_XA_RMI: connection is erroneous

--  WARN   logWarning, atomikos MessageConsumer proxy for com.ibm.mq.jms.MQQueueReceiver@73085060: The JMS session you are using requires a JTA transaction context for the calling thread and none was found.
    WARN   logWarning, Error in proxy
    com.atomikos.jms.AtomikosTransactionRequiredJMSException: The JMS session you are using requires a JTA transaction context for the calling thread and none was found.
    Please correct your code to do one of the following: 
    1. start a JTA transaction if you want your JMS operations to be subject to JTA commit/rollback, or
    2. increase the maxPoolSize of the AtomikosConnectionFactoryBean to avoid transaction timeout while waiting for a connection, or
    3. create a non-transacted session and do session acknowledgment yourself, or
    4. set localTransactionMode to true so connection-level commit/rollback are enabled.
        at com.atomikos.jms.AtomikosTransactionRequiredJMSException.throwAtomikosTransactionRequiredJMSException(AtomikosTransactionRequiredJMSException.java:40)

誰かがこの問題に直面したことがある場合は、どのように解決したかをお知らせください。

4

0 に答える 0