Spring not able to lookups a DataSource deployed by Tomcat using BTMTransaction Manager

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Spring not able to lookups a DataSource deployed by Tomcat using BTMTransaction Manager

Ouadi
This post was updated on .
Hi,

I was configure BTM in Tomcat 7 in order to use jBPM5.4, i have followed all these steps http://docs.codehaus.org/display/BTM/Tomcat  carefully.

But after deploying my web-app in Tomcat 7, these errors appears and i'am not able to resolve them.

WARNING: Failed to register in JMX: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_jbpmDS', available resources: []
May 02, 2013 4:52:38 PM org.apache.catalina.core.NamingContextListener addResource
WARNING: Failed to register in JMX: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
May 02, 2013 4:52:38 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
May 02, 2013 4:52:40 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'txInterceptor' while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txInterceptor' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-persistence-1.0.0-SNAPSHOT.jar!/selectsystem-persistence-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-resources.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        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:196)
        at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:722)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:410)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'txInterceptor' while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txInterceptor' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-persistence-1.0.0-SNAPSHOT.jar!/selectsystem-persistence-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-resources.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        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:196)
        at org.springframework.aop.framework.autoproxy.BeanFactoryAdvisorRetrievalHelper.findAdvisorBeans(BeanFactoryAdvisorRetrievalHelper.java:86)
        at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findCandidateAdvisors(AbstractAdvisorAutoProxyCreator.java:100)
        at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:86)
        at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:359)
        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        ... 20 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txInterceptor' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-persistence-1.0.0-SNAPSHOT.jar!/selectsystem-persistence-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-resources.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        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)
        ... 38 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-service-1.0.0-SNAPSHOT.jar!/selectsystem-service-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-persistence-1.0.0-SNAPSHOT.jar!/selectsystem-persistence-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-resources.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        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)
        ... 48 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/home/ouadi/ETUDES/MS-SID/infos_Stage/Projet_Workflow_Monetique/workspace_stage/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/portal-web/WEB-INF/lib/portal-persistence-1.0.0-SNAPSHOT.jar!/selectsystem-persistence-context.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-resources.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        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)
        ... 58 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring/applicationContext-resources.xml]: Invocation of init method failed; nested exception is javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        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)
        ... 68 more
Caused by: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/s2m_workflowDS', available resources: []
        at bitronix.tm.resource.ResourceObjectFactory.getObjectInstance(ResourceObjectFactory.java:57)
        at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:143)
        at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:154)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:831)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
        at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
        at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
        at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
        at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
        at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
        at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
        ... 75 more

=============

Here is my Spring config files:


        <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
                <property name="jndiName">
                        <value>java:comp/env/jdbc/s2m_workflowDS</value>
                </property>
        </bean>

      <bean id="jpaProperties"
                class="org.springframework.beans.factory.config.PropertiesFactoryBean">
                <property name="properties">
                        <props>
                                <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
                                <prop key="hibernate.show_sql">false</prop>
                                <prop key="hibernate.connection.autocommit">true</prop>
                                <prop key="hibernate.hbm2ddl.auto">update</prop>
                                <prop key="hibernate.query.jpaql_strict_compliance">false</prop>
                                <prop key="hibernate.cache.provider_class">
                                        org.hibernate.cache.EhCacheProvider
                                </prop>
                                <prop key="hibernate.transaction.manager_lookup_class">
                                    org.hibernate.transaction.BTMTransactionManagerLookup
                                </prop>
                                <prop key="hibernate.cache.use_query_cache">false</prop>
                                <prop key="hibernate.cache.use_second_level_cache">true</prop>
                                <prop key="hibernate.cglib.use_reflection_optimizer">false</prop>
                        </props>
                </property>
        </bean>


        <bean
                class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
                id="entityManagerFactory">
               
                <property name="persistenceUnitName" value="entityManager" />
               
                <property name="jpaProperties" ref="jpaProperties" />
                <property name="dataSource" ref="dataSource"></property>
                <property name="persistenceXmlLocation">
                        <value>classpath:META-INF/persistence.xml</value>
                </property>
        </bean>               

----

In this application already configured in my company, they use this bean,

        <bean class="org.springframework.orm.jpa.JpaTransactionManager"
                id="transactionManager">
               
                <property name="entityManagerFactory" ref="entityManagerFactory" />
        </bean>

==============

context.xml:

        <Resource name="jdbc/s2m_workflowDS" uniqueName="jdbc/s2m_workflowDS" auth="Container" type="javax.sql.DataSource"
                driverClassName="com.mysql.jdbc.Driver"
                factory="bitronix.tm.resource.ResourceObjectFactory"
                url="jdbc:mysql://localhost:3306/dbName"
                username="root" password="pass" maxActive="100" maxIdle="100"
                maxWait="1000" />

        <Resource name="jdbc/s2m_jbpmDS" uniqueName="jdbc/s2m_jbpmDS" auth="Container" type="javax.sql.DataSource"
                driverClassName="com.mysql.jdbc.Driver"
                factory="bitronix.tm.resource.ResourceObjectFactory"
                url="jdbc:mysql://localhost:3306/dbName"
                username="root" password="pass" maxActive="100" maxIdle="100"
                maxWait="1000" />

===================

resources.properties :

resource.ds1.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
resource.ds1.uniqueName=jdbc/s2m_workflowDS
resource.ds1.minPoolSize=5
resource.ds1.maxPoolSize=25
#resource.ds1.driverProperties.driverClassName=org.gjt.mm.mysql.Driver
resource.ds1.driverProperties.url=jdbc:mysql://localhost:3306/dbName
#resource.ds1.driverProperties.user=root
#resource.ds1.driverProperties.password=pass
#
resource.ds2.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
resource.ds2.uniqueName=jdbc/s2m_jbpmDS
resource.ds2.minPoolSize=5
resource.ds2.maxPoolSize=25
#resource.ds2.driverProperties.driverClassName=org.gjt.mm.mysql.Driver
resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/dbName
#resource.ds2.driverProperties.user=root
#resource.ds2.driverProperties.password=pass


Can you help me please.