Atomikos Forum |
|
Hi,
meybe my problem sound very banal to you... I tried to use the basic case example into my OSGi bundle (Equinox 3.5, Spring DM 1.1.3, Spring 2.5.6.A) Altough this basic example is marked with 'pre 3.3', I exaptec to make it work. When my bundle start, I get following exception: java.lang.IllegalArgumentException: Cannot convert value of type [com.atomikos.icatch.jta.UserTransactionManager] to required type [javax.transaction.TransactionManager] for property 'transactionManager': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386) Is there a newer approach? What went wrong? Best regards Dirk
I have the same problem. Did you solve it?
See my spring configuration below: <code> <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <tx:annotation-driven transaction-manager="jtaTransactionManager" /> <context:component-scan base-package="br.com.emmti.*" /> <!-- Construct Atomikos UserTransactionManager, needed to configure Spring --> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close"> <!-- when close is called, should we force transactions to terminate or not? --> <property name="forceShutdown" value="false" /> </bean> <!-- Also use Atomikos UserTransactionImp, needed to configure Spring --> <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"> <property name="transactionTimeout" value="300" /> </bean> <!-- Configure the Spring framework to use JTA transactions from Atomikos --> <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="transactionManager"><ref bean="atomikosTransactionManager" /></property> <property name="userTransaction"><ref bean="atomikosUserTransaction" /></property> </bean> <!-- Factory entity managers --> <bean id="entityManagerFactorySve" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="SvePU" /> </bean> <bean id="entityManagerFactoryTeste" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="TestePU" /> </bean> <!-- Is for exception translation, we don’t extend from JPATemplate but we can still have this feature. --> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> </beans> </code> and here is my persistence.xml <code> <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="TestePU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>br.com.emmti.to.Tabela1TO</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="hibernate.connection.datasource" value="java:/comp/env/jdbc/TesteSveDS"/> <property name="hibernate.dialect" value="com.hxtt.support.hibernate.HxttAccessDialect"/> <property name="hibernate.hbm2ddl.auto" value="validate"/> </properties> </persistence-unit> <persistence-unit name="SvePU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>br.com.emmti.sve.cidade.model.to.CidadeTO</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="hibernate.connection.datasource" value="java:/comp/env/jdbc/SVEDS"/> <property name="hibernate.dialect" value="com.hxtt.support.hibernate.HxttAccessDialect"/> <property name="hibernate.hbm2ddl.auto" value="validate"/> </properties> </persistence-unit> </persistence> </code> |