psagarna (11) [Avatar] Offline
Hi all,

I´ becaming be crazy with the config JPA in activiti. I will apreaciate any observation from you becouse I can not see the problem becouse the same config with a webapp works fine.

I have the next configs:

persistence.xml inside activiti-explorer/META-INF contains:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="" xmlnssmiliesi="" xsi:schemaLocation="">
<persistence-unit name="testJPA" transaction-type="RESOURCE_LOCAL">
<property name="openjpa.ConnectionURL" value="jdbc:mysql://localhost/jpatest"/>
<property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
<property name="openjpa.ConnectionUserName" value="root"/>
<property name="openjpa.ConnectionPassword" value=""/>
<property name="openjpa.RuntimeUnenhancedClasses" value="supported"/>

2) applicationContext.xml keep the instalation default and this part only add few lines:

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="databaseType" value="h2" />
<property name="dataSource" ref="dataSource" />
<property name="databaseSchemaUpdate" value="true" />
<!--property name="transactionManager" ref="transactionManager" /-->
<property name="jobExecutorActivate" value="false" />
<property name="transactionManager" ref="transactionManager" />
<property name="jpaPersistenceUnitName" value="testJPA" />
<property name="jpaHandleTransaction" value="true" />
<property name="jpaCloseEntityManager" value="true" />

<property name="customFormTypes">
<ref bean="userFormType"/>

<bean id="order" class="" />
<bean id="book" class="" />

3) BookService which is calling from one serviceActiviti and is working fine the call but fails the part of JPA particulary entityManagerFactory>

public Book createBook(DelegateExecution execution) {

Book pablo= new Book();

EntityManagerFactory emf = javax.persistence.Persistence.createEntityManagerFactory("testJPA");
EntityManager em = emf.createEntityManager();

Query q = em.createQuery("SELECT c FROM Book c");
List<Book> companias = q.getResultList();
Iterator<Book> iterator=companias.iterator();
while (iterator.hasNext()) {
Book pablo2 = (Book);
return pablo;

4)openjpa-2.2.0.jar and mysql*jar all of them are in activiti-explorer/WEB-INF/lib

4) After this the exception is
Caused by: org.activiti.engine.impl.javax.el.ELException: <openjpa-2.2.0-r422266 >
:1244990 fatal user error> org.apache.openjpa.persistence.ArgumentException: A J
DBC Driver or DataSource class name must be specified in the ConnectionDriverNam
e property. Available properties in configuration are "org.apache.openjpa.jdbc.c

Many thanks,


tijs.rademakers (494) [Avatar] Offline
Re: JPA with Activiti configs files

This looks like a OpenJPA issue to me. Are you sure the persistence.xml configuration is correct for OpenJPA?

Best regards,

psagarna (11) [Avatar] Offline
Re: JPA with Activiti configs files
Hi Tijs,

Yes, I have try the same config file with webproject and works. But I think there are something wrong in the processEngineConfiguration is that posible? Are ok these lines:
<property name="jpaPersistenceUnitName" value="testJPA" />
<property name="jpaHandleTransaction" value="true" />
<property name="jpaCloseEntityManager" value="true" />

Also, I have tried to run the same project (which are in section 6.3.3) outside eclipse and junit test (becouse runs with junits test) in activiti tomcat but it is not running, other exceptions happends. I guessing some problems with applicationContext is that posible?

Many thanks,