2 Replies Latest reply on Sep 17, 2013 4:04 PM by Al Koch

    Very 1st attempt to make a call to a jBPM API Throws!

    Al Koch Newbie

      Hello,

       

      I am trying to integrate jBPM 5.4 into an existing servlet.  The servet runs fine with JBoss 7.1 but it fails with a thrown exception when I add a single jBPM related API.  (I used the evaluation sample from the jbpm-5.4.0.Final-installer-full.zip installation as a template.)  I added to the servlet's doPost():

       

      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

       

      and the following exception is thrown as soon as we execute this statement:

       

      20:51:06,394 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/myservlet].[myservlet]] (http-localhost-127.0.0.1-8080-2) Servlet.service() for servlet myservlet threw exception: java.lang.NoClassDefFoundError: org/drools/builder/KnowledgeBuilderFactory

          at com.mycompany.myservlet.doPost(myservlet.java:413) [classes:]

          at com.mycompany.myservlet.doGet(myservlet.java:120) [classes:]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_11]

       

      We also have:

       

      import org.drools.KnowledgeBase;

      import org.drools.builder.KnowledgeBuilder;

      import org.drools.builder.KnowledgeBuilderFactory;

      import org.drools.builder.ResourceType;

      import org.drools.io.ResourceFactory;

      import org.drools.logger.KnowledgeRuntimeLogger;

      import org.drools.logger.KnowledgeRuntimeLoggerFactory;

      import org.drools.runtime.StatefulKnowledgeSession;

      import org.jbpm.process.workitem.wsht.HornetQHTWorkItemHandler;

       

      Can smeone please explain what has gone wrong here?

       

      Thank you.

      Al

        • 1. Re: Very 1st attempt to make a call to a jBPM API Throws!
          Maciej Swiderski Master

          most likely your web application is missing some of jbpm dependencies in this case it's drools libraries. Make sure you have all drools libs in WEB-INF/lib and that should resolve this issue.

           

          HTH

          • 2. Re: Very 1st attempt to make a call to a jBPM API Throws!
            Al Koch Newbie

            Hi Maciej,

             

            Thank you for your response.  I tried to implement your suggestion but I still have the exception.  I'm sure part of the problem is that I'm "in the dark" about these libraries.  I started from the jBPM 5.4 Full Installer (jbpm-5.4.0.Final-installer-full.zip) and that created a .\runtime folder in which I found the following:

             

            drools-compiler.jar

            drools-compiler-5.5.0.Final.jar

            drools-core.jar

            drools-core-5.5.0.Final.jar

            drools-decisiontables.jar

            droolsjbpm-ide-common.jar

            drools-jsr94.jar

            drools-persistence-jpa-5.5.0.Final.jar

            drools-templates.jar

             

            I placed all of these in .\WEB-INF\lib but this has not solved the problem.

             

            Do I have the necessary .jars in the list above?  Can you suggest what is going wrong?

             

            Again, thank you for your help.

             

            Al