Spring統合プロジェクトでの分散トランザクション管理にAtomikosを使用しようとしています。メッセージ駆動型のチャネルアダプタで接続ファクトリとしてAtomikosConnectionFactoryBeanを使用しようとすると問題が発生します。Spring統合メッセージ駆動型チャネルアダプタを使用したAtomikosConnectionFactoryBeanのコンフィグレーション
私は、エラーの下に取得しています:
Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect to queue manager 'NYHUB6S' with connection mode 'Client' and host name 'nyhub6s.us.ml.com'.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:608) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:236) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:430) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.wmq.internal.WMQXAConnection.<init>(WMQXAConnection.java:70) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createV7ProviderConnection(WMQXAConnectionFactory.java:190) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.wmq.factories.WMQConnectionFactory.createProviderConnection(WMQConnectionFactory.java:6210) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.wmq.factories.WMQXAConnectionFactory.createProviderXAConnection(WMQXAConnectionFactory.java:102) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.jms.admin.JmsConnectionFactoryImpl.createXAConnectionInternal(JmsConnectionFactoryImpl.java:371) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.mq.jms.MQXAQueueConnectionFactory.createXAQueueConnection(MQXAQueueConnectionFactory.java:144) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.mq.jms.MQXAQueueConnectionFactory.createXAConnection(MQXAQueueConnectionFactory.java:98) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.atomikos.datasource.xa.jms.JmsTransactionalResource.refreshXAConnection(JmsTransactionalResource.java:73) ~[transactions-jta-4.0.4.jar:na]
... 17 common frames omitted
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:223) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
... 26 common frames omitted
Caused by: com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009;AMQ9204: Connection to host 'nyhub6s.us.ml.com(1467)' rejected. [1=com.ibm.mq.jmqi.JmqiException[CC=2;RC=2009],3=nyhub6s.us.ml.com(1467),5=RemoteRcvThread.run]
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:2072) ~[com.ibm.mq.jmqi-7.0.1.8.jar:7.0.1.8 - k701-108-120201]
at com.ibm.mq.jmqi.remote.internal.RemoteFAP.jmqiConnect(RemoteFAP.java:1286) ~[com.ibm.mq.jmqi-7.0.1.8.jar:7.0.1.8 - k701-108-120201]
at com.ibm.msg.client.wmq.internal.WMQConnection.<init>(WMQConnection.java:345) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
... 25 common frames omitted
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
at com.ibm.mq.jmqi.remote.internal.RemoteRcvThread.run(RemoteRcvThread.java:362) ~[com.ibm.mq.jmqi-7.0.1.8.jar:7.0.1.8 - k701-108-120201]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.runTask(WorkQueueItem.java:209) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.commonservices.workqueue.SimpleWorkQueueItem.runItem(SimpleWorkQueueItem.java:100) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueItem.run(WorkQueueItem.java:224) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.commonservices.workqueue.WorkQueueManager.runWorkQueueItem(WorkQueueManager.java:298) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
at com.ibm.msg.client.commonservices.j2se.workqueue.WorkQueueManagerImplementation$ThreadPoolWorker.run(WorkQueueManagerImplementation.java:1220) ~[com.ibm.mqjms-7.0.1.1.jar:7.0.1.1 - k701-101-091116]
は私の春の統合とAtomikosの設定は以下の通りです:
<bean id="xaConnectionFactory" class="com.ibm.mq.jms.MQXAQueueConnectionFactory">
<property name="hostName">
<value>${receiving.queue.hostname}</value>
</property>
<property name="port">
<value>${receiving.queue.port}</value>
</property>
<property name="queueManager">
<value>${receiving.queue.manager}</value>
</property>
<property name="channel">
<value>${receiving.queue.channel}</value>
</property>
<property name="transportType">
<value>1</value>
</property>
</bean>
<bean id="jmsQueueConnectionFactory"
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory" ref="xaConnectionFactory" />
<property name="username" value="${mqSeriesUserName}" />
<property name="password" value="${mqSeriesPassword}" />
</bean>
<!-- lets wrap in a pool to avoid creating a connection per send -->
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
<property name="targetConnectionFactory" ref="jmsQueueConnectionFactory"/>
<property name="sessionCacheSize" value="5"/>
<property name="reconnectOnException" value="true"/>
</bean>
<!--
<bean id="requestQueue1" class="com.ibm.mq.jms.MQQueue">
<property name="baseQueueName" value="${receiving.queue1}" />
JMSC.MQJMS_CLIENT_NONJMS_MQ is one
<property name="targetClient" value="1" />
</bean>
<bean id="requestQueue2" class="com.ibm.mq.jms.MQQueue">
<property name="baseQueueName" value="${receiving.queue2}" />
JMSC.MQJMS_CLIENT_NONJMS_MQ is one
<property name="targetClient" value="1" />
</bean>
<bean id="requestQueue3" class="com.ibm.mq.jms.MQQueue">
<property name="baseQueueName" value="${receiving.queue3}" />
JMSC.MQJMS_CLIENT_NONJMS_MQ is one
<property name="targetClient" value="1" />
</bean> -->
<!-- XA related changes -->
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close">
<property name="transactionTimeout" value="120"/>
<property name="forceShutdown">
<value>false</value>
</property>
</bean>
<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp" >
</bean>
<bean id="atomikos_ConnectionFactory" class="com.atomikos.jms.AtomikosConnectionFactoryBean">
<property name="xaConnectionFactory" ref="xaConnectionFactory"/>
<property name="uniqueResourceName" value="MQSeries_XA_RMI"/>
<property name="poolSize" value="2" />
<property name="maxPoolSize" value="10" />
<property name="maxIdleTime" value="15" />
</bean>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManager"> <ref bean ="atomikosTransactionManager"/></property>
<property name="userTransaction"> <ref bean="atomikosUserTransaction" /></property>
</bean>
<beans profile="SINGLE_REQUEST_Q">
<jms:message-driven-channel-adapter id="exch" destination="requestQueue" channel="jmsInChannel"
transaction-manager="transactionManager" acknowledge="transacted" connection-factory="atomikos_ConnectionFactory" />
<bean id="requestQueue" class="com.ibm.mq.jms.MQQueue">
<property name="baseQueueName" value="${receiving.queue.${exch}}" />
<property name="targetClient" value="1" />
</bean>
</beans>
私はAtomikosConnectionFactoryBean
するためのユーザーIDとパスワードを使用して、キャッシュファクトリ参照を渡す必要がありますが、 MQXAQueueConnectionFactory
以外は何も受け取りません。 UserCredentialsConnectionFactoryAdapter
またはCachingConnectionFactory
〜AtomikosConnectionFactoryBean
beanのいずれかを渡すコメントまたはポインタをお知らせください。
こんにちはアルテム、Usercredential connectionfactoryのAtomikos接続ファクトリは役に立ちませんでした。もう一度同じエラーが発生しましたが、私はXAConnectionFactoryのラッパーを作成しようとしましたが、それも助けになりませんでした。 –
OK。いいえ、アイデア。ごめんなさい。問題は確かに資格情報であるという事実ではありません... –