0 Replies Latest reply on Aug 3, 2012 9:18 PM by binglim

    Error message while using JPAKnowledgeService and how to do external Signaling with persistence

    binglim Newbie



      I am trying to use persistence such that an external signaling can continue a workflow process that is in a wait-state.

      (I plan on running SignalEvent.java after ProcessMain is in a wait state to trigger the signal node and continue with the workflow)





      However, I get these errors when I run ProcessMain.java.





      Exception in thread "main" java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

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

                at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67)

                at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)

                at com.sample.ProcessMain.main(ProcessMain.java:62)

      Caused by: java.lang.reflect.InvocationTargetException

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

                at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

                at java.lang.reflect.Constructor.newInstance(Unknown Source)

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

                ... 3 more

      Caused by: java.lang.NullPointerException

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

                ... 8 more



      1) I read the documentations and it states:
      // recreate the session from database using the sessionId

      ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( sessionId, kbase, null, env );


      Does the kbase has to be the original knowledgebase? or am I allowed to create a new knowledgebase but as long as the sessionId is correct, I can signal a bpmn workflow externally that is on a different knowledgebase?




      2) Can someone elaborate what the error message means and how to do external signaling with persistence and JPAKnowledgeService?



      Any help is appreciated. Thanks!