Jonathan Albornoz
2013-01-10 13:50:05 UTC
Jonathan Albornoz [https://community.jboss.org/people/betoflint] created the discussion
"JPAKnowledgeService Exception"
To view the discussion, visit: https://community.jboss.org/message/790106#790106
--------------------------------------------------------------
Hi people, i'm running the project that comes with the book of jbpm development guide, the chapter 8.
I run everything, i have configured jbpm 5.4 with jboss 7.1.1 and oracle like my db persistence.
but when i want runit appear the next exception. Any idea why??
The code where appear the exception is the next.
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
       kbuilder.add(new ClassPathResource("process-async-interactions.bpmn"), ResourceType.BPMN2);
       if (kbuilder.hasErrors()) {
           for (KnowledgeBuilderError error : kbuilder.getErrors()) {
               System.out.println(">>> Error:" + error.getMessage());
           }
           System.out.println(">>> Hay problemas con el archivo .bpmn! ");
       }
       KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
       kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
       Environment env = EnvironmentFactory.newEnvironment();
       EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.runtime");
       env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
       env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
       // Let's create a Persistence Knowledge Session
       System.out.println(" >>> Let's create a Persistent Knowledge Session");
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); //here generate the exception.
The exception code....
Exception in thread "main" java.lang.NoSuchMethodError: org.drools.SessionConfiguration.addDefaultProperties(Ljava/util/Properties;)V
         at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.mergeConfig(KnowledgeStoreServiceImpl.java:147)
         at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:66)
         at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
         at com.salaboy.jbpm5.correr.crearProceso(correr.java:90)
         at com.salaboy.jbpm5.correr.main(correr.java:41)
thanks!!!!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/790106#790106]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
"JPAKnowledgeService Exception"
To view the discussion, visit: https://community.jboss.org/message/790106#790106
--------------------------------------------------------------
Hi people, i'm running the project that comes with the book of jbpm development guide, the chapter 8.
I run everything, i have configured jbpm 5.4 with jboss 7.1.1 and oracle like my db persistence.
but when i want runit appear the next exception. Any idea why??
The code where appear the exception is the next.
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
       kbuilder.add(new ClassPathResource("process-async-interactions.bpmn"), ResourceType.BPMN2);
       if (kbuilder.hasErrors()) {
           for (KnowledgeBuilderError error : kbuilder.getErrors()) {
               System.out.println(">>> Error:" + error.getMessage());
           }
           System.out.println(">>> Hay problemas con el archivo .bpmn! ");
       }
       KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
       kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
       Environment env = EnvironmentFactory.newEnvironment();
       EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.runtime");
       env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
       env.set(EnvironmentName.TRANSACTION_MANAGER, TransactionManagerServices.getTransactionManager());
       // Let's create a Persistence Knowledge Session
       System.out.println(" >>> Let's create a Persistent Knowledge Session");
StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env); //here generate the exception.
The exception code....
Exception in thread "main" java.lang.NoSuchMethodError: org.drools.SessionConfiguration.addDefaultProperties(Ljava/util/Properties;)V
         at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.mergeConfig(KnowledgeStoreServiceImpl.java:147)
         at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:66)
         at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
         at com.salaboy.jbpm5.correr.crearProceso(correr.java:90)
         at com.salaboy.jbpm5.correr.main(correr.java:41)
thanks!!!!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/790106#790106]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]