0 Replies Latest reply on Jan 19, 2017 7:02 AM by Artem A

    ClassNotFoundException: org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate

    Artem A Newbie

      We have an application that uses jBPM 6.5 libraries to manage workflow processes.

      Our application consists of 3 modules:

      - core (here are bpmn processes and jbpm jars as dependencies)

      - jca (integration with the ESB)

      - ui

      Each of those is a war deployment deployed on the EAP 7.0 server.

      Now and then, I get an exception in server log files:

       

      java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:185)

          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:70)

          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:39)

          at org.kie.internal.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:121)

          at org.jbpm.runtime.manager.impl.factory.JPASessionFactory.newKieSession(JPASessionFactory.java:42)

          at org.jbpm.runtime.manager.impl.PerRequestRuntimeManager$PerRequestInitializer.initKieSession(PerRequestRuntimeManager.java:203)

          at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getKieSession(RuntimeEngineImpl.java:70)

          at org.jbpm.process.core.timer.impl.GlobalTimerService.getCommandService(GlobalTimerService.java:233)

          at org.jbpm.process.core.timer.impl.GlobalTimerService.getCommandService(GlobalTimerService.java:203)

          at org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:75)

          at org.jbpm.persistence.timer.GlobalJpaTimerJobInstance.call(GlobalJpaTimerJobInstance.java:47)

          at java.util.concurrent.FutureTask.run(FutureTask.java:266)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)

          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

          at java.lang.Thread.run(Thread.java:745)

      Caused by: java.lang.reflect.InvocationTargetException

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

          at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:171)

          ... 16 more

      Caused by: java.lang.IllegalArgumentException: Timer service 'new org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate("default-per-request-timerServiceId")' not found

          at org.drools.core.SessionConfigurationImpl.newTimerService(SessionConfigurationImpl.java:427)

          at org.drools.core.time.TimerServiceFactory.getTimerService(TimerServiceFactory.java:27)

          at org.drools.core.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:369)

          at org.drools.core.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:282)

          at org.drools.core.common.PhreakWorkingMemoryFactory.createWorkingMemory(PhreakWorkingMemoryFactory.java:42)

          at org.drools.core.impl.KnowledgeBaseImpl.newStatefulSession(KnowledgeBaseImpl.java:1437)

          at org.drools.core.impl.KnowledgeBaseImpl.newStatefulSession(KnowledgeBaseImpl.java:1422)

          at org.drools.core.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:308)

          at org.drools.core.impl.KnowledgeBaseImpl.newKieSession(KnowledgeBaseImpl.java:385)

          at org.drools.persistence.SingleSessionCommandService.initNewKnowledgeSession(SingleSessionCommandService.java:132)

          at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:99)

          ... 21 more

      Caused by: [Error: unable to resolve class: org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate from [Module "deployment.jca-SNAPSHOT.war:main" from Service Module Loader]]

      [Near : {... new org.jbpm.process.core.timer.im ....}]

                       ^

      [Line: 1, Column: 5]

          at org.mvel2.ast.NewObjectNode.getReducedValue(NewObjectNode.java:301)

          at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:101)

          at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:47)

          at org.mvel2.MVEL.eval(MVEL.java:92)

          at org.drools.core.util.MVELSafeHelper$RawMVELEvaluator.eval(MVELSafeHelper.java:421)

          at org.drools.core.SessionConfigurationImpl.newTimerService(SessionConfigurationImpl.java:425)

          ... 31 more

      Caused by: java.lang.ClassNotFoundException: org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate from [Module "deployment.jca-SNAPSHOT.war:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)

          at java.lang.Class.forName0(Native Method)

          at java.lang.Class.forName(Class.java:348)

          at org.mvel2.util.ParseTools.createClass(ParseTools.java:503)

          at org.mvel2.util.ParseTools.findClass(ParseTools.java:926)

          at org.mvel2.ast.NewObjectNode.getReducedValue(NewObjectNode.java:260)

          ... 36 more

       

       

      The problem is that it tries to load RegisteredTimerServiceDelegate from the wrong module. The module 'jca' doesn't have jbpm dependencies, only 'core' does.

      I couldn't reproduce the bug. Sometimes it goes days without it, sometimes there are few in a day. I have no idea what to do. I tried passing the parameter -Dmvel2.disable.jit=true to no avail.

       

      Here are the dependencies that are used by 'core' module:

      compile "org.jbpm:jbpm-runtime-manager:6.5.0.Final"

      compile "org.jbpm:jbpm-flow:6.5.0.Final"

      compile "org.jbpm:jbpm-flow-builder:6.5.0.Final"

      compile "org.jbpm:jbpm-bpmn2:6.5.0.Final"

      compile "org.jbpm:jbpm-persistence-jpa:6.5.0.Final"

      compile "org.jbpm:jbpm-human-task-core:6.5.0.Final"

      compile "org.jbpm:jbpm-human-task-jpa:6.5.0.Final"

      compile "org.jbpm:jbpm-services-cdi:6.5.0.Final"

      compile "org.jbpm:jbpm-workitems:6.5.0.Final"

      compile "org.jbpm:jbpm-executor:6.5.0.Final"

      compile "org.jbpm:jbpm-executor-cdi:6.5.0.Final"