0

Spring アプリケーションでAtomikosを構成しようとしています。私は使っている:

  • アトミコス 3.7.1 (TransactionsEssentials)
  • 春 3.0.2
  • ティブコ EMS 5.1

JNDI for JMS を使用した接続ファクトリーの構成の詳細と、Tibco EMS 構成に関する詳細を教えてもらえますか?

私は次のことを試しました:

 <bean id="jmsTemplate2" class="org.springframework.jms.core.JmsTemplate" >
    <property name="connectionFactory" ref="amqConnectionFactory" />
    <property name="defaultDestination" ref="queue" />
    <property name="sessionTransacted" value="true"/>
    <property name="messageConverter" ref="messageConverter"></property>
</bean>


<bean id="amqConnectionFactory" class="com.atomikos.jms.AtomikosConnectionFactoryBean"    init-method="init">
    <property name="uniqueResourceName" value="XAEMS" />
    <property name="xaConnectionFactory" ref="connectionFactory" />
    <property name="poolSize" value="10" />
</bean>

<jee:jndi-lookup id="connectionFactory" jndi-name="emsConnectionFactory">
    <jee:environment>
        java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
        java.naming.provider.url=tibjmsnaming://localhost:7222
    </jee:environment>
</jee:jndi-lookup> 

<jee:jndi-lookup id="queue" jndi-name="emsQueue">
    <jee:environment>
        java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
        java.naming.provider.url=tibjmsnaming://localhost:7222
    </jee:environment>
</jee:jndi-lookup>

しかし、このエラーが発生します:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'amqConnectionFactory' defined in file [C:\springsource\vfabric-tc-server-developer-2.6.4.RELEASE\spring-insight-instance\wtpwebapps\iRebal-Backend-Poc-Web-Integration-Final-xa\WEB-INF\classes\META-INF\spring\batch\jobs\priority-queue.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory' to required type 'javax.jms.XAConnectionFactory' for property 'xaConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory] to required type [javax.jms.XAConnectionFactory] for property 'xaConnectionFactory': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 39 more
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory' to required type 'javax.jms.XAConnectionFactory' for property 'xaConnectionFactory'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory] to required type [javax.jms.XAConnectionFactory] for property 'xaConnectionFactory': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl
4

2 に答える 2

1

この答えはOPには遅すぎますが、後世のために:

必要なクラスは com.tibco.tibjms.TibjmsXAConnectionFactory です。

于 2014-03-17T20:35:38.097 に答える
0

クラスには、そのタイプ(またはゲッターの戻り値のタイプ)がcom.atomikos.jms.AtomikosConnectionFactoryBeanという名前のフィールドがあるようです。ただし、Spring 構成ファイルでは、そのフィールドが のインスタンスで設定されるように構成しました。xaConnectionFactoryjavax.jms.XAConnectionFactorycom.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory

に変換com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactoryできないようjavax.jms.XAConnectionFactoryです。

于 2012-04-24T06:48:32.897 に答える