cancel
Showing results for 
Search instead for 
Did you mean: 

Error Initializing Activiti Process Engine using version 5.19.0.2

marcdekker
Champ in-the-making
Champ in-the-making
I am trying to start a very basic messaging event for a proof of concept.


public static void main(String[] args) throws InterruptedException {
        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        RuntimeService runtimeService = processEngine.getRuntimeService();
        for(int i=0;i<10;i++) {
            ProcessInstance message = runtimeService.startProcessInstanceByMessage("gaap");
            Thread.sleep(60000);
        }
}


When i try to run i get the following exception:
Exception in thread "main" org.activiti.engine.ActivitiException: couldn't initialize process engine from spring configuration resource file:/{filepath}/activiti-context.xml: Class org.activiti.engine.ProcessEngines can not access a member of class org.activiti.spring.SpringConfigurationHelper with modifiers "public static"
   at org.activiti.engine.ProcessEngines.initProcessEngineFromSpringResource(ProcessEngines.java:130)
   at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:109)
   at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:224)
   at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:217)
   at {sandbox}.main(ErrorQueueMessageListener.java:11)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:497)
   at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.IllegalAccessException: Class org.activiti.engine.ProcessEngines can not access a member of class org.activiti.spring.SpringConfigurationHelper with modifiers "public static"
   at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
   at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
   at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
   at java.lang.reflect.Method.invoke(Method.java:490)
   at org.activiti.engine.ProcessEngines.initProcessEngineFromSpringResource(ProcessEngines.java:122)
   … 9 more


It quess it is happening because the class org.activiti.spring.SpringConfigurationHelper is not public
I can't seem to find a workaround.
Can someone tell me how to start a runtime service without hitting this class, fix the problem or how to start a message event without a runtime service.

My gradatuted in advance
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
So is your process engine config xml via Spring? Or how do you want to boot up your process engine.

Anyway, a more direct approach would be not to use the getDefaultProcesEngine() method, but instantiate a new one yourself, for example new StandaloneProcessEngineConfiguration().