I have created a war file in which i have written deployment code in a java delegate. I have deployed a new bpmn using this and once i start the process I am able to run the recently deployed process using java api. But when I restart the server or redeploying the war and then tried to run the process which i deployed earlier using java api ,I am getting the error. So is there any configuration i need to enable to handle this issue. I am using camunda with tomcat distribution.
Error:
The process could not be started. : Cannot instantiate process definition demo-process2:1:0b87ff8e-108f-11e8-9188-9cad97d34f79: ENGINE-09008 Exception while instantiating class ‘com.sp.demo.camunda_poc.ServiceTask4Delegate’: ENGINE-09017 Cannot load class ‘com.sp.demo.camunda_poc.ServiceTask4Delegate’: com.sp.demo.camunda_poc.ServiceTask4Delegate
Due to the use of enableDuplicateFiltering(false) you’re creating a new deployment every time.
Afterwards this deployment gets your process application registered.
All previously created deployments are without process application then, you have to handle them too.
Similar like this way:
Thanks @Iangfr for the info.
I have changed the code to “enableDuplicateFiltering(true)” but still I am getting the same error.
So that means each time you restart the camunda tomcat server we need to register all the bpmn deployed earlier using the java API again.
Please correct my understandings as in our use case we want to deploy a lot of bpm dynamically.
I’m using Wildfly and not Tomcat, but this should make no difference in general.
After startup you have to call registerProcessApplication for all of your existing deployments.
In my case I’m doing this in my process application after it’s started. The same is necessary if you redeploy your application.
Although name of the classes and methods are the same, you have to inform the engine about the new deployment so that the classloader can find your artefacts.