[jboss-user] [jBPM] New message: "Re: JBPM 4.3 and JPA/Hibernate integration question"

Flavio Donzé do-not-reply at jboss.com
Mon Feb 1 06:44:05 EST 2010


User development,

A new message was posted in the thread "JBPM 4.3 and JPA/Hibernate integration question":

http://community.jboss.org/message/523318#523318

Author  : Flavio Donzé
Profile : http://community.jboss.org/people/flavio.donze

Message:
--------------------------------------------------------------
Hello
 
I'm having the same problems as Christian stated. We are using JPA transations which worked in version 4.1 and I can't get it running in 4.3 because of the mentioned NPE.
 
We also have an EntityManager and using the following configurations we provided the connection and transations manager to jBPM:
 
*jbpm.hibernate.cfg.xml*
<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE hibernate-configuration PUBLIC
          -//Hibernate/Hibernate Configuration DTD 3.0//EN
          http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd>

<hibernate-configuration>
  <session-factory>
     <property name="hibernate.dialect">${hibernate.dialect}</property>
     <property name="hibernate.hbm2ddl.auto">update</property>
     <property name="hibernate.jdbc.batch_size">2000</property>
     <property name="javax.persistence.transactionType">JTA</property>
     <property name="hibernate.transaction.manager_lookup_class">com.softmodeler.server.persistence.SoftmodelerTransactionManagerLookup</property>
     <property name="hibernate.connection.provider_class">com.softmodeler.server.persistence.SoftmodelerConnectionProvider</property>
     
     <mapping resource="jbpm.repository.hbm.xml" />
     <mapping resource="jbpm.execution.hbm.xml" />
     <mapping resource="jbpm.history.hbm.xml" />
     <mapping resource="jbpm.task.hbm.xml" />
     <mapping resource="jbpm.identity.hbm.xml" />
  </session-factory>
</hibernate-configuration>


Notice the "hibernate.transaction.manager_lookup_class" and the "hibernate.connection.provider_class" properties.
 
The Spring configuration looked like this, no sessionFactory bean is defined:
     <osgi:reference id="transactionManager" interface="org.jencks.GeronimoPlatformTransactionManager"/>
        <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
           <constructor-arg value="jbpm.cfg.xml"/>
     </bean>

     <bean id="jbpmProcessEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine"/>
     <bean id="jbpmRepositoryService" factory-bean="jbpmProcessEngine" factory-method="getRepositoryService" />
     <bean id="jbpmExecutionService" factory-bean="jbpmProcessEngine" factory-method="getExecutionService" />
     <bean id="jbpmTaskService" factory-bean="jbpmProcessEngine" factory-method="getTaskService" />

 
I tried to hack around the code to get it working, made my own SpringProcessEngine without using LocalSessionFactoryBean.
     public static ProcessEngine create(ConfigurationImpl configuration) {
          MySpringProcessEngine springProcessEngine = null;
 
          ApplicationContext applicationContext = null;
 
          applicationContext = (ApplicationContext) configuration.getApplicationContext();
 
          springProcessEngine = new MySpringProcessEngine();
          springProcessEngine.applicationContext = applicationContext;
          springProcessEngine.initializeProcessEngine(configuration);
 
          // do not create session, hibernate configuration is set in jbpm.cfg.xml
 
          springProcessEngine.checkDb(configuration);
 
          return springProcessEngine;
     }

 
Well now I'm getting a different NPE, jBPM is trying to access org.springframework.transaction.PlatformTransactionManager, but I'm using org.apache.geronimo.transaction.manager.GeronimoTransactionManager.
What would be the correct way to hock in my TransationManager?
 
greets and thanks

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/523318#523318




More information about the jboss-user mailing list