Atomikos Forum |
|
I am getting this exception when using atomikos jpa implementation in spring framework:
" org.springframework.beans.factory.support.BeanDefinitionValidationException: Couldn't find an init method named 'init' on bean with name 'userTransactionService'" This is my applicationContext.xml file: <?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:aop="http://www.springframework.org/schema/aop" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:context="http://www.springframework.org/schema/context" xmlns:lang="http://www.springframework.org/schema/lang" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-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 http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> <!-- ******************************************************************** --> <!-- Scan for dao layer annotated beans --> <!-- ******************************************************************** --> <context:component-scan base-package="com.pedja.dao" scoped-proxy="interfaces" /> <context:component-scan base-package="com.pedja.domain" scoped-proxy="interfaces" /> <context:component-scan base-package="com.pedja.service" scoped-proxy="interfaces" /> <context:component-scan base-package="com.pedja.rest" scoped-proxy="interfaces" /> <!-- ******************************************************************** --> <!-- Mark bean transactions as annotation driven --> <!-- ******************************************************************** --> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- ******************************************************************** --> <!-- PropertyConfigurer for the DAO --> <!-- ******************************************************************** --> <context:property-placeholder location="classpath:Rest-dao.properties" /> <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" depends-on="userTransactionService" destroy-method="close" init-method="init"> <property name="forceShutdown" value="true" /> <property name="startupTransactionService" value="false" /> <property name="transactionTimeout" value="260" /> </bean> <!-- <bean id="localLogAdministrator" class="com.atomikos.icatch.admin.imp.LocalLogAdministrator"/> --> <bean id="userTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp" init-method="init" destroy-method="shutdownForce"> <constructor-arg> <!-- IMPORTANT: specify all Atomikos properties here --> <props> <prop key="com.atomikos.icatch.service"> com.atomikos.icatch.standalone.UserTransactionServiceFactory </prop> <prop key="com.atomikos.icatch.enable_logging"> false </prop> </props> </constructor-arg> <!-- <property name="initialLogAdministrators"> --> <!-- <list> --> <!-- <ref bean="localLogAdministrator"/> --> <!-- </list> --> <!-- </property> --> </bean> <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp" depends-on="userTransactionService"/> <!-- Configure the Spring framework to use JTA transactions from Atomikos --> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="userTransactionService"> <property name="transactionManager" ref="atomikosTransactionManager" /> <property name="userTransaction" ref="atomikosUserTransaction" /> <property name="transactionSynchronizationName" value="SYNCHRONIZATION_ON_ACTUAL_TRANSACTION" /> </bean> <!-- Using Apache DBCP Data Sources --> <bean name="com_mysql_driverDS" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" > <property name="driverClassName" value="${com_mysql_driver.connection.driver_class}" /> <property name="username" value="${com_mysql_driver.connection.username}" /> <property name="password" value="${com_mysql_driver.connection.password}" /> <property name="url" value="${com_mysql_driver.connection.url}" /> <property name="maxIdle" value="${com_mysql_driver.minPoolSize}" /> <property name="maxActive" value="${com_mysql_driver.maxPoolSize}" /> </bean> <bean id="com_mysql_driverJPAVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="${com_mysql_driver.show_sql}" /> <property name="generateDdl" value="${com_mysql_driver.generateDdl}" /> <property name="databasePlatform" value="${com_mysql_driver.dialect}" /> </bean> <!-- EntityManager Factory that brings together the persistence unit, datasource, and JPA Vendor --> <bean id="com_mysql_driverB" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="com_mysql_driverDS" /> <property name="persistenceUnitName" value="com_mysql_driver" /> <property name="jpaVendorAdapter" ref="com_mysql_driverJPAVendorAdapter" /> <property name="jpaPropertyMap"> <map> <entry key="hibernate.transaction.manager_lookup_class" value="com.atomikos.icatch.jta.hibernate3.TransactionManagerLookup" /> <entry key="hibernate.connection.release_mode" value="on_close" /> </map> </property> </bean> </beans> Can get any help please?Thanks |