2 Replies Latest reply on Sep 23, 2013 4:52 PM by alkoch

    Can't access a jBPM .BPMN file from a JBoss servlet




      I am trying to add jBPM 5.4 support to a servlet.  I have ported a Tomcat servlet to run with JBoss 7.1 and am now trying to add jBPM support to it.  I have run the jbpm-5.4.0.Final-installer-full.zip to get JBoss/jBPM installed with Kepler (I had to patch the installer to install Kepler).  I then copied the following two lines of code from the installer's "evaluation" sample and placed them in my servlet:


      KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

      kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);


      After adding the necessary imports I got a clean build.  I the placed the JARS from drools-distribution-5.5.0.Final.zip (from http://www.jboss.org/drools/downloads) in my .\WEB-INF\lib and I am able to execute the 1st line of jBPM code (the KnowledgeBuilder line.  However, when I step across the 2nd line (with ResourceFactory.newClassPathResource()) I get the following:


      12:29:02,243 ERROR [stderr] (http-localhost- java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BPMN2ProcessProvider'

      12:29:02,243 ERROR [stderr] (http-localhost-     at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:166)

      12:29:02,243 ERROR [stderr] (http-localhost-     at org.drools.compiler.BPMN2ProcessFactory.loadProvider(BPMN2ProcessFactory.java:28)



      12:29:02,259 ERROR [stderr] (http-localhost- Caused by: java.lang.ClassNotFoundException: org.jbpm.bpmn2.BPMN2ProcessProviderImpl from [Module "deployment.MyServer.war:main" from Service Module Loader]

      12:29:02,259 ERROR [stderr] (http-localhost-     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)


      My questions are:

      1) Is this error because of a missing JAR?  If so, can you tell me what JAR is missng?

      2) Is placing the sample BPMN file (Evaluation.bpmn) in my classpath sufficient for the code to locate it?


      Thank you.


        • 1. Re: Can't access a jBPM .BPMN file from a JBoss servlet

          yes, this is due to missing library (jbpm-bpmn2), please check your other post regarding where to find all libraries required.



          Please do not duplicate your questions as that makes it much harder for community to keep track of all issues.



          • 2. Re: Can't access a jBPM .BPMN file from a JBoss servlet

            Hi Maciej,


            Thank you very much for your reply.  I understand the need to avoid "duplicate" posts but please understand that I have become a bit desperate because I have been struggling for weeks to get this problem resolved and I am getting very little response to my posts.  As a result I have been trying to post the problem with different Topics and Descriptions in the hope that it will catch someone's attention.  I really appreciate that you have responded to several of my posts today.  If you would, please respond again to my reply in


            What Drools JARS are needed in a servet's WEB-INF\lib for jBPM?


            to see if you can help me get the datasource defined that you recommended.


            Again, thank you for your help!