5 Replies Latest reply on Mar 26, 2014 10:47 PM by zhoushaohe

    Advice on jBPM without jBOSS AS (with Tomcat)



        I am investigating jBPM and Activiti as possible alternatives for process engines in our software. We want to create a service layer that will live in tomcat and execute processes when they are triggered by certain actions. I was looking at any pointers, documents, how-to of making jBPM work with Tomcat. Can you provide any pointers? I am doing searches and finding threads like How to deploy JBPM 6 in Tomcat7? .. That gives me some information, but does not give me specific steps on how to make things work. I also want to know if I am shooting myself in the foot by trying to setup an environment that the project owners do not want to certify/actively support. (I have this feeling since I am not finding any documentation of using jBPM with tomcat.) So please do let me know if that is the case.


        I want to create a simple workflow and deploy/execute in my unit test with the process engine living in tomcat. I will do that using jBPM and Activiti. Once I get to that point, I want to create multiple scenarios to test both systems on.


      Thanks for any help you can provide.



      ETA:  Found another useful tomcat related link .. I will follow this document and see where it takes me. JBPM 5.3 / Tomcat 7 / H2 / Demo

        • 1. Re: Advice on jBPM without jBOSS AS (with Tomcat)

          I have made some progress, but it seems that I am unable to start the application. I have Tomcat 7.0.50, kie-wb-distribution-wars-6.0.1.Final-tomcat7.war in the webapps directory, I have added the jar files and updated the setup as pointed out here.


          This is the exception I am getting: Any help will be appreciated


          Feb 05, 2014 12:50:26 PM org.apache.catalina.core.StandardContext listenerStart


          SEVERE: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener


          org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [UserGroupInfoProducer] with qualifiers [@Selectable] at injection point [[field] @Inject @Selectable private org.kie.workbench.backend.ApplicationScopedProducer.userGroupInfoProducer]. Possible dependencies [[Managed Bean [class org.jbpm.kie.services.cdi.producer.JAASUserGroupInfoProducer] with qualifiers [@Any @Selectable], Managed Bean [class org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer] with qualifiers [@Any @Selectable]]]


              at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:314)

          .... snipped ....


          ETA: Read some more about the ambiguous dependencies and updated the beans.xml and commented out class org.jbpm.kie.services.cdi.producer.DefaultUserGroupInfoProducer and now I have KIE workbench on tomcat. .. now for further experimentation

          • 2. Re: Advice on jBPM without jBOSS AS (with Tomcat)

            It feels like I am talking to myself Anyway, this will help someone else if I don't get any answers!


            So I tried to run unit test in eclipse and tried to create a process instance on the kie-wb. (That is another question, the tomcat war, is that kie-workbench as the name suggests or is that jbpm-console? Salaboy's post here has made some differentiation between the two.)


            I tried to add the plugins to eclipse using the blog post -> Eclipse plug-in Installation for jBPM5

            Of course I used latest jar files. So I can see the bpmn file in bpmn2 process editor. I imported evaluation sample in eclipse, added external jars to the project (all the jar files from jbpm.final.1.0.1.bin.zip) and all errors went away. However, when I run the unit test, I get an error -

            2014-02-05 17:12:50,795 [main] ERROR Wed Feb 05 17:12:50 EST 2014: Error when creating task on task server for work item id 1. Error reported by task server: Unknown entity: org.jbpm.services.task.audit.TaskEventImpl

            java.lang.IllegalArgumentException: Unknown entity: org.jbpm.services.task.audit.TaskEventImpl

                at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:878) ~[hibernate-entitymanager-4.2.0.SP1.jar:4.2.0.SP1]

                at org.jbpm.services.task.persistence.JPATaskPersistenceContext.persist(JPATaskPersistenceContext.java:450) ~[jbpm-human-task-core-6.0.1.Final.jar:6.0.1.Final]


            So then I tried to deploy the process evaluation on my jbpm console. I was successful in that. Then I tried to create a process instance. Here it failed. An errors comes up for a second and goes away  .. It says "Process Instances failed to start org.hibernate.exception.genericJDBCexception  .could not prepare statement

            On the tomcat window, it spits out an error.

            [05/02/14 05:55:36:036 EST] ERROR spi.SqlExceptionHelper: error enlisting a Jdbc

            ConnectionHandle of a JdbcPooledConnection from datasource jdbc/jbpm in state AC

            CESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on conn1778: url=jdb

            c:h2:file:~/jbpm user=SA on a JDBC LrcConnectionHandle on a JDBC LrcXAResource i

            n state NO_TX


            So neither example works for me. As always any help is greatly appreciated!

            • 3. Re: Advice on jBPM without jBOSS AS (with Tomcat)

              when it comes to tomcat there are no special needs for the application itself. You can take a look at jbpm console (kie-wb) that provides tomcat 7 version of the application that provides complete modeling and execution environment. See details about configuration for kie-wb on tomcat here.



              • 4. Re: Advice on jBPM without jBOSS AS (with Tomcat)

                see this thread for the missing class definition in persistence.xml



                • 5. Re: Advice on jBPM without jBOSS AS (with Tomcat)

                  Have you resolved ?  I encontered this problem too , any help ,   thank you