2 Replies Latest reply on Apr 10, 2013 5:38 PM by tunnaruto

    JPAKnowledgeService Exception

    Jonathan Albornoz Newbie

      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!!!!