lakshmi sampath [
https://community.jboss.org/people/lakshmi.sampath] created the
discussion
"Re: Does RESOURCE_LOCAL work with JBPM"
To view the discussion, visit:
https://community.jboss.org/message/724849#724849
--------------------------------------------------------------
Mauricio, I am trying to create a statefull session, but the error always goes into
checking for JTA UserTransaction inside SingleSessionCommandService.
Here's the exception and below are my config files and java code. Hope its something
simple you can point out!!! Thx
--------------------------------------------------------------------------------------------------------------------------
14:03:06,392 ERROR [SingleSessionCommandService] Could not commit session
java.lang.NullPointerException
at
org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:197)
at
org.drools.persistence.jta.JtaTransactionManager.begin(JtaTransactionManager.java:150)
at
org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:120)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)
at
org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)
at
org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
-----------------------persistence.xml----------------------------------------------
<persistence-unit name="org.jbpm.engine.persistence.jpa"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>java:jbpmDS</non-jta-data-source>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<class>org.jbpm.process.audit.ProcessInstanceLog</class>
<class>org.jbpm.process.audit.NodeInstanceLog</class>
<class>org.jbpm.process.audit.VariableInstanceLog</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validate"
/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.JBossTransactionManagerLookup" />
</properties>
</persistence-unit>
</persistence>
---------------Spring config file----------------------------------
<jee:jndi-lookup id="processengine.dataSource"
jndi-name="java:/jbpmDS"/>
<context:annotation-config/>
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory"
ref="entityManagerFactory" />
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName"
value="org.jbpm.engine.persistence.jpa" />
<property name="dataSource"
ref="processengine.dataSource" />
</bean>
<bean id="processEngine" name="processEngine"
class="com.processengine.jbpm.impl.MyJBPMHandler">
<property name="emf" ref="entityManagerFactory"
/>
</bean>
--------------End spring config file----------------------------------
-------------------MyJBPMHandler Java class-----------------------------------------
public class MyJBPMHandler{
private javax.persistence.EntityManagerFactory emf;
public EntityManagerFactory getEmf() {
return emf;
}
public void setEmf(EntityManagerFactory emf) {
this.emf = emf;
}
public void init(){
KnowledgeBase kbase =
KnowledgeBuilderFactory.newKnowledgeBuilder().newKnowledgeBase();
Environment env = KnowledgeBaseFactory.newEnvironment();
env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase,null,env);
}
}
----------------------------------------------------------------------------
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/724849#724849]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]