AnsweredAssumed Answered

Cannot deploy processes after enabling JPA [Solved]

Question asked by damokles on Feb 9, 2012
Hi,

We've got the following Problem:
We want to use JPA for some processes, which works now.
But after enabling JPA we cannot deploy our processes via the Activti Explorer anymore,
there are no exceptions in the logs and nothing happens in the database either.


Here are the relevant parts of the applicationContext.xml:

   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
     <property name="driverClassName" value="${jdbc.driver}" />
     <property name="url" value="${jdbc.url}" />
     <property name="username" value="${jdbc.username}" />
     <property name="password" value="${jdbc.password}" />
      <property name="defaultAutoCommit" value="false" />
   </bean>

   <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />


   <bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
   <property name="persistenceXmlLocation">
         <value>classpath:persistence.xml</value>
   </property>
   </bean>

   <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
   <property name="persistenceUnitManager" ref="persistenceUnitManager" />
   <property name="dataSource" ref="dataSource" />
   </bean>

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

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
   <property name="jpaEntityManagerFactory" ref="entityManagerFactory" />
   <property name="jpaHandleTransaction" value="true" />
   <property name="jpaCloseEntityManager" value="true" />
      <property name="jobExecutorActivate" value="false" />   
   </bean>
We're using Hibernate for JPA, we tried the user guide examples and the examples from Activiti in Action.

[Solution]
We found the solution, you have to use "org.springframework.jdbc.datasource.SimpleDriverDataSource" instead of "org.apache.commons.dbcp.BasicDataSource"
[/Solution]

Outcomes