ENGINE-16004 Exception while closing command context, NullPointerException: org.apache.ibatis.exceptions.PersistenceException

Hi,

While executing ProcessInstanceQuery list() operation, we got the below exception just couple of times in almost two months. We tried a lot to reproduce this in our environment but Could Not Reproduce.

Camunda version : 7.7.0

[org.camunda.bpm.engine.context] ENGINE-16004 Exception while closing command context: #012### Error querying database. Cause: java.lang.NullPointerException#012
Cause: java.lang.NullPointerException: org.apache.ibatis.exceptions.PersistenceException: #012
Error querying database. Cause: java.lang.NullPointerException#012
Cause: java.lang.NullPointerException#012#011

	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)#012#011
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)#012#011
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)#012#011
	at org.camunda.bpm.engine.impl.db.sql.DbSqlSession.selectList(DbSqlSession.java:88) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectListWithRawParameter(DbEntityManager.java:168) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:160) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.selectList(DbEntityManager.java:152) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.persistence.entity.ExecutionManager.findProcessInstancesByQueryCriteria(ExecutionManager.java:134) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.ProcessInstanceQueryImpl.executeList(ProcessInstanceQueryImpl.java:242) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressionsAndExecuteList(AbstractQuery.java:186) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.AbstractQuery.execute(AbstractQuery.java:163) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:58) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011
	at org.camunda.bpm.engine.impl.AbstractQuery.list(AbstractQuery.java:137) [camunda-engine-7.7.0-ee.jar:7.7.0-ee]#012#011

Would like to know if this issue has happened before and anyone aware of any possible reason for this NullPointerException ?

Any information related to this issue is much appreciated.

Regards,
Ronald

Hi Ronald,

Please post the complete stacktrace.

Cheers,
Thorben