2 Replies Latest reply on Aug 2, 2013 2:21 AM by Mariusz Cwikla

    OSGi: Caused by: java.lang.ClassNotFoundException: org.drools.persistence.jpa.KnowledgeStoreServiceImpl

    Mariusz Cwikla Newbie

      Hello,

      I'm trying to run JBPM 5.4 inside an OSGi container. I've encountered a problem when using JPAKnowledgeService.newStatefulKnowledgeSession.

      I get following error:

       

      java.lang.RuntimeException: Provider org.drools.persistence.jpa.KnowledgeStoreServiceImpl could not be set.

                at org.drools.persistence.jpa.JPAKnowledgeService.loadProvider(JPAKnowledgeService.java:155)

                at org.drools.persistence.jpa.JPAKnowledgeService.getJPAKnowledgeServiceProvider(JPAKnowledgeService.java:143)

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

                ....

      Caused by: java.lang.ClassNotFoundException: org.drools.persistence.jpa.KnowledgeStoreServiceImpl

       

      I found out that JPAKnowledgeService uses reflection to instantiate KnowledgeStoreServiceImpl class. Both classes are in org.drools.persistence.jpa package, but one is knowledge-api-5.5.0.Final.jar and second is in drools-persistence-jpa-5.5.0.Final.jar.

       

      I'm not an OSGi expert, but I think that both classes should be in one .jar file (currently it's "split packages" problem).

       

      Currently I have a workaround to use KnowledgetStoreServiceImpl directly and not use JPAKnowledgeService.

      Or is there another workaround?