we have embedded the camunda engine in one of our applications. While it runs fine on the development machines we keep getting the following output when deploying the application:
[error] o.c.b.e.context - ENGINE-16004 Exception while closing command context: null
java.lang.NullPointerException: null
at org.camunda.bpm.engine.impl.db.entitymanager.cache.CachedDbEntity.isDirty(CachedDbEntity.java:53)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushCachedEntity(DbEntityManager.java:434)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flushEntityCache(DbEntityManager.java:417)
at org.camunda.bpm.engine.impl.db.entitymanager.DbEntityManager.flush(DbEntityManager.java:283)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:203)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.close(CommandContext.java:132)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:113)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.camunda.bpm.engine.impl.ManagementServiceImpl.setProperty(ManagementServiceImpl.java:161)
In some cases value is null which works fine in the first place (it gets populated in act_ge_properties) but it fails on update with the above error.
String name = "emailEncryption";
String value = null;
engine.getManagementService().setProperty(name, value); // <-- works
log.info("Property was set");
engine.getManagementService().setProperty(name, value); // <-- error
log.info("Property was updated");
f_a, how did you manage to resolve it?
i have the same problem when im using @PostConstruct annotation in the method that creates the properties.
When i remove the anotation, i can call engine.getManagementService().setProperty many times and there is no error.