Thursday, November 15, 2012

Activiti getDbSqlSession() nullPointer exception

Trying to use getDbSqlSession() to access my own Oracle tables in Activiti-Explorer:


connection = getDbSqlSession().getSqlSession().getConnection();

And it gives me nullPointer exception. After many failures, here's the solution, in /WEB-INF/applicationContext.xml, add one more property for bean processEngineConfiguration:

<property name="transactionsExternallyManaged" value="true" />

This will solve the problem.


Important: I used this in Spring Beans, which was used in <activiti:formProperty>, if you use it directly, better use JPAContainer.
 

No comments: