bodi bajk [
http://community.jboss.org/people/urdo2] created the discussion
"Re: Drools, Spring integration and JTA in container"
To view the discussion, visit:
http://community.jboss.org/message/582792#582792
--------------------------------------------------------------
Maybe the problem is in my configuration:
.....
<drools:ksession id="jpaSingleSessionCommandService"
type="stateful" kbase="knowledgeBase">
<drools:configuration>
<drools:work-item-handlers>
<!-- .... -->
</drools:work-item-handlers>
<drools:jpa-persistence>
<drools:transaction-manager
ref="transactionManager"/>
<drools:entity-manager-factory
ref="entityManagerFactory"/>
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
.....
<jee:jndi-lookup id="entityManagerFactory"
jndi-name="java:/org.drools.persistence.jpa.local"/>
<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName"
value="java:/TransactionManager"/>
<property name="userTransactionName"
value="UserTransaction"/>
</bean>
.....
During deployment, application throws NullpointerException in class:
SingleSessionCommandService
because when invoked initTransactionManager(Environment env) method:
Object tm = env.get( EnvironmentName.TRANSACTION_MANAGER );
....
if ( tm.getClass().getName().toLowerCase().contains( "jpa" ) ) {
// configure spring for JPA and local transactions
cls = Class.forName(
"org.drools.container.spring.beans.persistence.DroolsSpringJpaManager" );
con = cls.getConstructors()[0];
this.jpm = ( JpaManager) con.newInstance( new Object[] { this.env }
);
} else {
// configure spring for JPA and distributed transactions
}
jpm is null,
because tm.getClass().getName() is not true, in my case
(org.springframework.transaction.jta.JtaTransactionManager)
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/582792#582792]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]