Websphere JTA事务配置

时间:2015-08-27 03:01:08

标签: spring websphere jta

我正在尝试使用websphereUOMmanager配置spring JTA事务

<bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager">
 </bean>

我得到了这个例外。

 Cannot convert value of type [org.springframework.transaction.jta.WebSphereUowTransactionManager] to required type [javax.transaction.TransactionManager] for property 'transactionManager': no matching editors or conversion strategy found

我删除了所有Javax.usertransaction jar,但仍然是相同的

这对我不起作用

<bean id="tranSactionManager"
    class="javax.transaction.TransactionManager" 
    factory-bean="transactionManager"
    factory-method="getTransactionManager">
</bean> 

这也不适合我

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

试过这个这个不行的

 <tx:jta-transaction-manager>

也试过这个

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

尝试父级首次加载类设置并尝试父级最后没有任何工作

我使用的是jdk 1.6,Spring 4.0.7,websphere 8.5可以任何人知道问题是什么吗?我使用了自动线,并给了value =构造函数,但是没有用。 这是我的堆栈跟踪

[8/26/15 20:01:44:425 EDT] 00000044 SystemOut     O 20:01:44.425 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'transactionManager'
[8/26/15 20:01:44:425 EDT] 00000044 SystemOut     O 20:01:44.425 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'transactionManager'
[8/26/15 20:01:44:425 EDT] 00000044 SystemOut     O 20:01:44.425 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'transactionManager' to allow for resolving potential circular references
[8/26/15 20:01:44:441 EDT] 00000044 SystemOut     O 20:01:44.441 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'transactionManager'
[8/26/15 20:01:44:441 EDT] 00000044 SystemOut     O 20:01:44.441 [server.startup : 0] DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/UserTransaction]
[8/26/15 20:01:44:441 EDT] 00000044 SystemOut     O 20:01:44.441 [server.startup : 0] DEBUG o.s.t.j.WebSphereUowTransactionManager - JTA UserTransaction found at default JNDI location [java:comp/UserTransaction]
[8/26/15 20:01:44:441 EDT] 00000044 SystemOut     O 20:01:44.441 [server.startup : 0] DEBUG o.s.t.j.WebSphereUowTransactionManager - Retrieving WebSphere UOWManager from default JNDI location [java:comp/websphere/UOWManager]
[8/26/15 20:01:44:441 EDT] 00000044 SystemOut     O 20:01:44.441 [server.startup : 0] DEBUG o.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/websphere/UOWManager]
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'transactionManager'
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'tranSactionManager'
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'tranSactionManager'
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'transactionManager'
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'tranSactionManager' to allow for resolving potential circular references
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'tranSactionManager'
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'wmqConnectionFactory'
[8/26/15 20:01:44:456 EDT] 00000044 SystemOut     O 20:01:44.456 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'wmqConnectionFactory'
[8/26/15 20:01:44:472 EDT] 00000044 SystemOut     O 20:01:44.472 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'wmqConnectionFactory' to allow for resolving potential circular references
[8/26/15 20:01:44:472 EDT] 00000044 SystemOut     O 20:01:44.472 [server.startup : 0] DEBUG o.s.beans.CachedIntrospectionResults - Not strongly caching class [com.ibm.mq.jms.MQXAConnectionFactory] because it is not cache-safe
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'wmqConnectionFactory'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'connectionFactory'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'connectionFactory'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'connectionFactory' to allow for resolving potential circular references
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'wmqConnectionFactory'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'com.lmig.cm.common.security.utils.CMSecurityUtils#d8cdcfb8'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'com.lmig.cm.common.security.utils.CMSecurityUtils#d8cdcfb8'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'connectionFactory'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'connectionFactory'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dialm1'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'dialm1'
[8/26/15 20:01:44:519 EDT] 00000044 SystemOut     O 20:01:44.519 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'db' to allow for resolving potential circular references
[8/26/15 20:01:44:534 EDT] 00000044 SystemOut     O 20:01:44.534 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'connectionFactory'
[8/26/15 20:01:44:534 EDT] 00000044 SystemOut     O 20:01:44.534 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'transactionManager'
[8/26/15 20:01:44:534 EDT] 00000044 SystemOut     O 20:01:44.534 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Finished creating instance of bean 'dialm1'
[8/26/15 20:01:44:534 EDT] 00000044 SystemOut     O 20:01:44.534 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'dataSource'
[8/26/15 20:01:44:534 EDT] 00000044 SystemOut     O 20:01:44.534 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating instance of bean 'dataSource'
[8/26/15 20:01:44:550 EDT] 00000044 SystemOut     O 20:01:44.550 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Eagerly caching bean 'dataSource' to allow for resolving potential circular references
[8/26/15 20:01:44:569 EDT] 00000044 SystemOut     O 20:01:44.569 [server.startup : 0] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Returning cached instance of singleton bean 'transactionManager'
[8/26/15 20:01:44:571 EDT] 00000044 SystemOut     O 20:01:44.571 [server.startup : 0] DEBUG org.springframework.beans.BeanUtils - No property editor [javax.transaction.TransactionManagerEditor] found for type javax.transaction.TransactionManager according to 'Editor' suffix convention
[8/26/15 20:01:44:603 EDT] 00000044 SystemOut     O 20:01:44.603 [server.startup : 0] WARN  o.s.w.c.s.XmlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [springConfig.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.springframework.transaction.jta.WebSphereUowTransactionManager' to required type 'javax.transaction.TransactionManager' for property 'transactionManager'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.transaction.jta.WebSphereUowTransactionManager] to required type [javax.transaction.TransactionManager] for property 'transactionManager': no matching editors or conversion strategy found

任何建议请

0 个答案:

没有答案