I have added all required maven depedencies, and jars. The same program is working with all activiti files. but not with Flowable.
Exception in thread “main” java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
org/flowable/engine/impl/cfg/IdmEngineConfigurator.configure(Lorg/flowable/engine/common/impl/AbstractEngineConfiguration;)V @24: invokevirtual
Reason:
Type ‘org/flowable/idm/engine/IdmEngineConfiguration’ (current frame, stack[2]) is not assignable to ‘org/flowable/engine/common/impl/AbstractEngineConfiguration’
Current Frame:
bci: @24
flags: { }
locals: { ‘org/flowable/engine/impl/cfg/IdmEngineConfigurator’, ‘org/flowable/engine/common/impl/AbstractEngineConfiguration’ }
stack: { ‘org/flowable/engine/impl/cfg/IdmEngineConfigurator’, ‘org/flowable/engine/common/impl/AbstractEngineConfiguration’, ‘org/flowable/idm/engine/IdmEngineConfiguration’ }
Bytecode:
0000000: 2ab4 000b c700 0e2a bb00 0c59 b700 0db5
0000010: 000b 2a2b 2ab4 000b b600 0e2a b400 0bb6
0000020: 000f 572a 2b2a b400 0bb6 0010 b1
Stackmap Table:
same_frame(@18)
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.initConfigurators(ProcessEngineConfigurationImpl.java:1211)
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:821)
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:798)
at servicetask.TestFlow1.main(TestFlow1.java:24)
My source code for testing Flowable process is…
package servicetask;
import java.util.HashMap;
import java.util.Map;
import org.flowable.engine.ProcessEngine;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.identitylink.service.IdentityLinkServiceConfiguration;
import org.flowable.variable.service.history.InternalHistoryVariableManager;
import org.flowable.common.engine.impl.scripting.ScriptingEngines;
import org.flowable.engine.common.impl.ScriptingEngineAwareEngineConfiguration;
import org.flowable.engine.common.api.FlowableException;
import org.flowable.job.service.impl.asyncexecutor.FailedJobCommandFactory;
import org.flowable.task.service.history.InternalHistoryTaskManager;
import org.flowable.image.ProcessDiagramGenerator;
import org.flowable.variable.api.types.VariableTypes;
import org.flowable.job.api.TimerJobQuery;
public class TestFlow1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
ProcessEngine processEngine = new StandaloneInMemProcessEngineConfiguration().setEnableProcessDefinitionInfoCache(true).buildProcessEngine();
Map<String,Object>variableMap=new HashMap<String,Object>();
variableMap.put("name","Flowable");
variableMap.put("abc",5);
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
// deploy process definition
repositoryService.createDeployment().addClasspathResource("ServiceProcess.bpmn").deploy();
// this will invoke OldServiceTask
ProcessInstance processInstance =
runtimeService.startProcessInstanceByKey("myProcess",variableMap);
String processDefinitionId = processInstance.getProcessDefinitionId();
// change service task class name
System.out.println("==== changing service task class name ====");
// DynamicBpmnService dynamicBpmnService = processEngine.getDynamicBpmnService();
// ObjectNode infoNode = dynamicBpmnService
//.changeServiceTaskClassName("dynamicServiceTask",
// "org.activiti.examples.NewServiceTask");
//dynamicBpmnService.saveProcessDefinitionInfo(processDefinitionId, infoNode);
// this will invoke NewServiceTask
//processInstance = runtimeService.startProcessInstanceByKey("dynamic-service-task");
}
}
I am confused, please let me know what went wrong.
Note: same program is working in activiti.
I have created a maven project and wrote th same testing frogram using all activiti imports, and same is working.
code is below.
package servicetask;
import java.util.HashMap;
import java.util.Map;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration;
import org.activiti.engine.runtime.ProcessInstance;
public class te {
public static void main(String[] args) {
// TODO Auto-generated method stub
ProcessEngine processEngine = new StandaloneInMemProcessEngineConfiguration().setEnableProcessDefinitionInfoCache(true).buildProcessEngine();
Map<String,Object>variableMap=new HashMap<String,Object>();
variableMap.put("name","Activiti");
variableMap.put("abc",5);
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
// deploy process definition
repositoryService.createDeployment().addClasspathResource("ServiceProcess.bpmn").deploy();
// this will invoke OldServiceTask
ProcessInstance processInstance =
runtimeService.startProcessInstanceByKey("myProcess",variableMap);
String processDefinitionId = processInstance.getProcessDefinitionId();
// change service task class name
System.out.println("==== changing service task class name ====");
// DynamicBpmnService dynamicBpmnService = processEngine.getDynamicBpmnService();
// ObjectNode infoNode = dynamicBpmnService
//.changeServiceTaskClassName("dynamicServiceTask",
// "org.activiti.examples.NewServiceTask");
//dynamicBpmnService.saveProcessDefinitionInfo(processDefinitionId, infoNode);
// this will invoke NewServiceTask
//processInstance = runtimeService.startProcessInstanceByKey("dynamic-service-task");
}
}
So, The question is, why the same code did not work with Flowable imports and depedencis.