5 Replies Latest reply on Nov 22, 2012 11:05 AM by Jiri Svitak

    Attempt to test human task API on jbpm5.4.CR1 failed

    dany171 Newbie

      Hi all,

       

      I tried to test the human task API over the jbpm5.4.CR1 version, based on https://community.jboss.org/people/bpmn2user/blog/2011/04/03/jbpm5-human-task-api-usage-example.

       

      I created  a maven project and started to setup it , so , I added dependencies into the pom.xml and configuring it to use jBPM5.4.CR1 libraries, because the original example did not compiled.

       

      After that I get the TaskServer running succesfully, I was very happy.

       

      Then I tried to run ProcessTaskAPITest class and in the instruction (the bold line)

       



      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();


      kbuilder.add(ResourceFactory.newClassPathResource(process), ResourceType.BPMN2);

       

      it throwns the next exception in execution time.

       

      java.lang.NoSuchMethodError: org.jbpm.workflow.core.node.EndNode.setScope(I)V

          at org.jbpm.bpmn2.xml.EndEventHandler.handleTerminateNode(EndEventHandler.java:116)

          at org.jbpm.bpmn2.xml.EndEventHandler.end(EndEventHandler.java:63)

          at org.drools.xml.ExtensibleXmlParser.endElement(ExtensibleXmlParser.java:417)

          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)

          at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(Unknown Source)

          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)

          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)

          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)

          at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)

          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)

          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)

          at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)

          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

          at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)

          at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:296)

          at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:175)

          at org.jbpm.compiler.xml.XmlProcessReader.read(XmlProcessReader.java:46)

          at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:247)

          at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:652)

          at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:688)

          at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)

          at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)

          at com.test.human.api.ProcessTaskAPITest.readKnowledgeBase(ProcessTaskAPITest.java:182)

          at com.test.human.api.ProcessTaskAPITest.main(ProcessTaskAPITest.java:116)

       

      I think, it is because of the versions of the dependencies in my pom.xml, because I changed them, but I can't fix it until now.

       

      I'm attaching my project, so, if somebody can take a look and give guideliness I will really appreciate (I have some days trying to run it), or fi anybody can share to me an project testing the human task api with jbpm 5.3 or 5.4 it will be really nice for me.

       

      Thanks in advanced.

        • 1. Re: Attempt to test human task API on jbpm5.4.CR1 failed
          Jiri Svitak Novice

          Hello,

          jBPM 5.4.0.Final is already released:

          http://sourceforge.net/projects/jbpm/files/jBPM%205/jbpm-5.4.0.Final/

           

          Please run your tests against Final version. The problem you mentioned might be fixed there. Thanks.

          • 2. Re: Attempt to test human task API on jbpm5.4.CR1 failed
            dany171 Newbie

            Hi, thanks for the answer, I have updated to jbpm5.4.0.Final but the problem persists. Any other suggestion?

            • 3. Re: Attempt to test human task API on jbpm5.4.CR1 failed
              Demian Calcaprina Master

              I see that you are using jbpm persistence:

              <dependency>

                        <groupId>org.jbpm</groupId>

                        <artifactId>jbpm-persistence-jpa</artifactId>

                        <version>5.3.0.Final</version>

              </dependency>

               

              adn jbpm human task



              <dependency>



              <groupId>org.jbpm</groupId>



              <artifactId>jbpm-human-task-mina</artifactId>



              <version>${jbpm.version}</version>


              </dependency>

               

              <jbpm.version>5.4.0.CR1</jbpm.version>

               

              You should use the same version there.. Could you please put the same versions there and check?

               

              Hope this helps,

               

              Demian

              • 4. Re: Attempt to test human task API on jbpm5.4.CR1 failed
                dany171 Newbie

                Thanks Demian,

                 

                I have updated the dependency to :

                <dependency>

                          <groupId>org.jbpm</groupId>

                          <artifactId>jbpm-persistence-jpa</artifactId>

                          <version>${jbpm.version}</version>

                </dependency>

                 

                where

                 

                <jbpm.version>5.4.0.Final</jbpm.version>

                 

                then I tested and got this exception:

                 

                javax.persistence.PersistenceException: [PersistenceUnit: org.jbpm.persistence.jpa] class or package not found

                    at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1093)

                    at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:871)

                    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:758)

                    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)

                    at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)

                    at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)

                    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

                    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

                    at com.test.human.api.ProcessTaskAPITest.createKnowledgeSession(ProcessTaskAPITest.java:194)

                    at com.test.human.api.ProcessTaskAPITest.main(ProcessTaskAPITest.java:117)

                Caused by: java.lang.ClassNotFoundException: org.jbpm.process.audit.ProcessInstanceLog

                    at java.net.URLClassLoader$1.run(Unknown Source)

                    at java.net.URLClassLoader$1.run(Unknown Source)

                    at java.security.AccessController.doPrivileged(Native Method)

                    at java.net.URLClassLoader.findClass(Unknown Source)

                    at java.lang.ClassLoader.loadClass(Unknown Source)

                    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

                    at java.lang.ClassLoader.loadClass(Unknown Source)

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

                    at java.lang.Class.forName(Unknown Source)

                    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:135)

                    at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1009)

                    at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1081)

                    ... 9 more

                 

                at this line:

                 

                EntityManagerFactory emf = Persistence.createEntityManagerFactory( "org.jbpm.persistence.jpa" );

                 

                This exception is much understandable than the other one, but, I already have the persistense unit  "org.jbpm.persistence.jpa"  defined in META-INF/persistence.xml

                 

                Please, could you take a look that file?, maybe some wrong definition..

                • 5. Re: Attempt to test human task API on jbpm5.4.CR1 failed
                  Jiri Svitak Novice

                  Hi,

                  you have to add a dependency for jbpm-bam module into your pom.xml.