org.jbpm.bpmn.model.BpmnProcessDefinition cannot be cast to org.jbpm.api.ProcessDefinitionImpl
michelemauro Feb 12, 2010 12:47 PMHi all!
I'm porting an application from jbpm3 to jbpm4, replacing the necessary parts. Our main goal is to be able to run BPMN2 diagrams. I have Spring 3 integration set up and all that, but I'm stumbling on an error I can't explain. I have searched google and the jira to no avail...
The setup:
I deploy the vacation process:
String key = repo.createDeployment().addResourceFromClasspath(
"processes/vacationrequest.bpmn.xml").deploy();
System.out.println("Deployed: " + key);
List<Deployment> deps = repo.createDeploymentQuery().list();
for (Deployment d : deps)
System.out.println(d.getId() + " " + d.getName() + " " + d.getState());
And everything goes fine. When I go querying for that process definition, however, I get:
Code:
Deployment d=repo.createDeploymentQuery().list().get(0);
String key= d.getId();
List<ProcessDefinition> list = repo.createProcessDefinitionQuery()
.deploymentId(key).list();
Exception:
java.lang.ClassCastException: org.jbpm.bpmn.model.BpmnProcessDefinition cannot be cast to org.jbpm.api.ProcessDefinitionImpl
at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.execute(ProcessDefinitionQueryImpl.java:72)
at org.jbpm.pvm.internal.query.AbstractQuery.execute(AbstractQuery.java:87)
at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:54)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
at org.jbpm.pvm.internal.query.AbstractQuery.untypedList(AbstractQuery.java:68)
at org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl.list(ProcessDefinitionQueryImpl.java:141)
at my.company.app.service.ContextRefreshListener.onApplicationEvent(ContextRefreshListener.java:46)
....
I can't understand why: the types are compatible. A classloader issue? but how?
The setup is quite trivial:
Hypersonic db - Spring 3 - Jetty webserver launched with mvn jetty:run
Anyone has a clue?
Thank you in advance,
Michele Mauro