9 Replies Latest reply on Sep 19, 2011 7:58 AM by salaboy21

    problems using jbpm5 integrated with oracle and tomcat

    kishoret

      Hi,

       

      I'm trying to develop a web application using jBPM5 integrating with Tomcat7, Oracle10. I could able to start tomcat server and execute code snippet successfully after integration.

       

      But while opening "Process Overview" under "Console", I'm getting below exception,

       

      Sep 2, 2011 5:39:07 PM org.apache.mina.filter.logging.LoggingFilter log

      INFO: CREATED

      Sep 2, 2011 5:39:07 PM org.apache.mina.filter.logging.LoggingFilter log

      INFO: OPENED

      No properties file: roles.properties found

      Sep 2, 2011 5:39:07 PM org.apache.mina.filter.logging.LoggingFilter log

      INFO: RECEIVED: HeapBuffer[pos=0 lim=178 cap=2048: 00 00 00 AE AC ED 00 05 73 72 01 00 1D 6F 72 67...]

      Sep 2, 2011 5:39:07 PM org.apache.mina.filter.logging.LoggingFilter log

      INFO: SENT: HeapBuffer[pos=0 lim=188 cap=256: 00 00 00 B8 AC ED 00 05 73 72 01 00 1D 6F 72 67...]

      Sep 2, 2011 5:39:07 PM org.apache.mina.filter.logging.LoggingFilter log

      INFO: SENT: HeapBuffer[pos=0 lim=0 cap=0: empty]

      jbpm.console.directory property not found

      Sep 2, 2011 5:39:13 PM org.apache.catalina.core.StandardWrapperValve invoke

      SEVERE: Servlet.service() for servlet [Resteasy] in context with path [/gwt-console-server] threw exception

      org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Could not initialize stateful knowledge session: No Persistence provider for EntityManager named org.jbpm.persistence.jpa

          at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)

          at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)

          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

          ...........

       

       

      Even in console its reporting about the properties file, I've set the path in Catalina.bat as,  [I'm not sure about roles.properties where to set in tomcat path?]

         set JBPM_DIRECTORY=-Djbpm.console.directory=C:/jbpm-installer/sample/evaluation/src/main/resources

       

       

      my code snippet:

           KnowledgeBase kbase;

              try {           

                  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

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

                  kbase = kbuilder.newKnowledgeBase();

       

                  System.out.println("Process flow started ");

                  StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

                  KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);

                  ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new WSHumanTaskHandler());

                 

                  // start a new process instance

                  Map<String, Object> params = new HashMap<String, Object>();

                  params.put("employee", "krisv");

                  params.put("reason", "Yearly performance evaluation");

                  ksession.startProcess("com.sample.evaluation", params);

                  System.out.println("Process Id : " + ksession.getId());

       

                  logger.close();

              } catch (Exception e) {

                  System.out.println("Exception occurred : ");

                  e.printStackTrace();

              }

          }

       

       

       

      Also I couldn't able to start "http://localhost:8080/drools-guvnor", do we need any extra configurations other than libraries?

       

      Your immediate response/help would be really greatfull. Please let me know if you need any information.

       

       

      Thanks,

        • 1. Re: problems using jbpm5 integrated with oracle and tomcat
          kishoret

          I have also updated "persistence-unit" from "org.jbpm.persistence.jpa" to "org.jbpm.task" in persistence.xml file. But still the issue is not resolved.

           

          Your help would be much appreciated ....

           

          Thanks,

          • 2. Re: problems using jbpm5 integrated with oracle and tomcat
            bpmn2user

            If you are getting the error about 'jbpm.console.directory', you need to check catalina.bat(sh).

            Updating persistence-unit would not help if the directory location is not set properly.

            http://community.jboss.org/people/bpmn2user/blog/2011/02/26/orcale-integration-with-jbpm5

            • 3. Re: problems using jbpm5 integrated with oracle and tomcat
              kishoret

              thank you for your reply

               

              I have followed all the steps mentioned in above link

               

              FYI, I have tried setting the path in catalina.bat as below,

                 -Djbpm.console.directory=C:\jbpm-installer\sample\evaluation\src\main\resources\Evaluation.bpmn

               

              but it seems the path is not setting up properly. Please let me know if any corrections

               

              Thanks,

              • 4. Re: problems using jbpm5 integrated with oracle and tomcat
                kishoret

                Hi,

                 

                Now I could able to resolve the issues with setting path of "jbpm.console.directory" and also opening "drools-guvnor" through tomcat.

                 

                I have again followed all the integration steps on a fresh server. But some how the same exception No Persistence provider for EntityManager named org.jbpm.persistence.jpa is still not fixed.

                 

                Please help me with any clues. Let me know if you need any further information.

                 

                Thanks,

                • 5. Re: problems using jbpm5 integrated with oracle and tomcat
                  salaboy21

                  Hi there.. the error is clear.. you must specify the persistence provider and add the hibernate dependencies in your classpath..

                  • 6. Re: problems using jbpm5 integrated with oracle and tomcat
                    kishoret

                    thank you Mauricio for the reply,

                     

                    below are my configuration details,

                     

                    Updated 'persistence.xml' in 'C:\apache-tomcat-7.0.19\webapps\gwt-console-server\WEB-INF\classes\META-INF\' and 'C:\apache-tomcat-7.0.19\webapps\gwt-console-server\WEB-INF\lib\jbpm-human-task-5.1.0.Final.jar\'

                     

                    <persistence-unit name="org.jbpm.task" transaction-type="JTA">

                        <provider>org.hibernate.ejb.HibernatePersistence</provider>

                        <jta-data-source>java:jdbc/testDummyDS</jta-data-source>

                        <mapping-file>META-INF/JBPMorm.xml</mapping-file>

                     

                        <class>org.jbpm.task.Attachment</class>

                        <class>org.jbpm.task.Content</class>

                        <class>org.jbpm.task.BooleanExpression</class>

                        <class>org.jbpm.task.Comment</class>

                        <class>org.jbpm.task.Deadline</class>

                        <class>org.jbpm.task.Comment</class>

                        <class>org.jbpm.task.Deadline</class>

                        <class>org.jbpm.task.Delegation</class>

                        <class>org.jbpm.task.Escalation</class>

                        <class>org.jbpm.task.Group</class>

                        <class>org.jbpm.task.I18NText</class>

                        <class>org.jbpm.task.Notification</class>

                        <class>org.jbpm.task.EmailNotification</class>

                        <class>org.jbpm.task.EmailNotificationHeader</class>

                        <class>org.jbpm.task.PeopleAssignments</class>

                        <class>org.jbpm.task.Reassignment</class>

                        <class>org.jbpm.task.Status</class>

                        <class>org.jbpm.task.Task</class>

                        <class>org.jbpm.task.TaskData</class>

                        <class>org.jbpm.task.SubTasksStrategy</class>

                        <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

                        <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

                        <class>org.jbpm.task.User</class>

                        <class>org.drools.persistence.info.SessionInfo</class>

                        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

                        <class>org.drools.persistence.info.WorkItemInfo</class>

                        <class>org.jbpm.process.audit.ProcessInstanceLog</class>

                        <class>org.jbpm.process.audit.NodeInstanceLog</class>

                        <class>org.jbpm.process.audit.VariableInstanceLog</class>

                        <properties>

                            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>

                            <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>

                     

                            <!--  [Due to security constraints I couldn't able to provide conncetion details here, but DB connection is working fine for me] -->

                            <property name="hibernate.connection.url" value="" />

                            <property name="hibernate.connection.username" value=""/>

                            <property name="hibernate.connection.password" value=""/>

                     

                            <property name="hibernate.connection.autocommit" value="false" />

                            <property name="hibernate.max_fetch_depth" value="3"/>

                            <property name="hibernate.hbm2ddl.auto" value="create" />

                            <property name="hibernate.show_sql" value="false" />

                        </properties>       

                      </persistence-unit>

                     

                     

                    hibernate.cfg.xml

                      <hibernate-configuration>

                        <session-factory>

                            <!-- Database connection settings -->

                            <property name="connection.driver_class">oracle.jdbc.OracleDriver</property>

                     

                        <!--  [Due to security constraints I couldn't able to provide conncetion details here, but DB connection is working fine for me] -->

                            <property name="connection.url"></property>

                            <property name="connection.username"></property>

                            <property name="connection.password"></property>

                     

                            <!-- JDBC connection pool (use the built-in) -->

                            <property name="connection.pool_size">1</property>

                            <!-- SQL dialect -->

                            <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>

                     

                            <!-- JTA transaction properties (begin) -->

                            <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>

                     

                            <!-- Enable Hibernate's automatic session context management -->

                            <property name="current_session_context_class">thread</property>

                     

                            <!-- Disable the second-level cache  -->

                            <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

                     

                            <!-- Echo all executed SQL to stdout -->

                            <property name="show_sql">false</property>

                     

                            <!-- Drop and re-create the database schema on startup -->

                            <property name="hbm2ddl.auto">create</property>

                     

                            <mapping resource="AuditLog.hbm.xml"/>

                     

                        </session-factory>

                      </hibernate-configuration>

                     

                     

                     

                    Note: Observed that after updating 'C:\apache-tomcat-7.0.19\conf\server.xml' file with '

                                   <Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />' [also added jar 'btm-tomcat55-lifecycle-1.3.3.jar'

                                   as mentioned in jboss forum], tomcat server is failing to start.

                     

                     

                    Please let me know if you need any further information.

                     

                    If any one has idea or faced related issue, pls share your thoughts.

                     

                     

                    Thanks,

                    • 7. Re: problems using jbpm5 integrated with oracle and tomcat
                      salaboy21

                      Tomcat fails to start? how?

                      I'm not a Tomcat expert but you are using

                       

                      btm-tomcat55-lifecycle-1.3.3.jar

                       

                      Inside tomcat 7? that could be the problem.. are you getting any exception that can help us to understand what is happening?

                      Cheers

                      • 8. Re: problems using jbpm5 integrated with oracle and tomcat
                        kishoret

                        Mauricio,

                         

                        Thanks for the reply.

                         

                        When I add '<Listener className="bitronix.tm.integration.tomcat55.BTMLifecycleListener" />' in server.xml, I guess there is some exception it is generating but from console I couldn't able to figure out as it is closing automatically. When I check the logs I could only see below message:

                         

                        log message

                        Sep 13, 2011 10:05:45 AM org.apache.catalina.core.AprLifecycleListener init

                        INFO: Loaded APR based Apache Tomcat Native library 1.1.20.

                        Sep 13, 2011 10:05:45 AM org.apache.catalina.core.AprLifecycleListener init

                        INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

                        Sep 13, 2011 10:05:45 AM org.apache.coyote.AbstractProtocol init

                        INFO: Initializing ProtocolHandler ["http-apr-8080"]

                        Sep 13, 2011 10:05:46 AM org.apache.coyote.AbstractProtocol init

                        INFO: Initializing ProtocolHandler ["ajp-apr-8009"]

                        Sep 13, 2011 10:05:46 AM org.apache.catalina.startup.Catalina load

                        INFO: Initialization processed in 1012 ms

                        Sep 13, 2011 10:05:46 AM bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent

                        INFO: Starting Bitronix Transaction Manager

                        Sep 13, 2011 10:05:46 AM bitronix.tm.BitronixTransactionManager logVersion

                        INFO: Bitronix Transaction Manager version 2.1.1

                        Sep 13, 2011 10:05:46 AM bitronix.tm.Configuration buildServerIdArray

                        INFO: JVM unique ID: <tomcat7-btm-node0>

                        Sep 13, 2011 10:05:46 AM bitronix.tm.resource.ResourceLoader init

                        INFO: reading resources configuration from C:/apache-tomcat-7.0.19/conf/btm-resources.properties

                         

                         

                        Below are my BTM configuration details,

                         

                        setenv.bat

                        set CATALINA_OPTS=-Dbtm.root=%CATALINA_HOME% -Dbitronix.tm.configuration=%CATALINA_HOME%\conf\btm-config.properties -Djbpm.console.directory=%JBPM_INSTALLER%\sample\evaluation\src\main\resources\

                         

                        btm-config.properties:    

                        bitronix.tm.serverId = tomcat7-btm-node0

                        bitronix.tm.journal.disk.logPart1Filename = ${btm.root}/work/btm1.tlog

                        bitronix.tm.journal.disk.logPart2Filename = ${btm.root}/work/btm2.tlog

                        bitronix.tm.resource.configuration = ${btm.root}/conf/btm-resources.properties

                         

                        btm-resources.properties:  [VALID DB URL, USER & PWD details are provided in my machine, not mentioning here.... ]

                        resource.defaultDS.className = oracle.jdbc.xa.client.OracleXADataSource

                        resource.defaultDS.uniqueName = jdbc/testDummyDS

                        resource.defaultDS.minPoolSize = 0

                        resource.defaultDS.maxPoolSize = 5

                        resource.defaultDS.allowLocalTransactions = true

                        resource.defaultDS.driverProperties.user =

                        resource.defaultDS.driverProperties.password =

                        resource.defaultDS.driverProperties.URL =

                        resource.ds1.driverProperties.driverClassName=oracle.jdbc.OracleDriver

                        resource.ds1.driverProperties.createDatabase=create

                         

                        context.xml

                        <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory" />

                         

                        <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" />

                               

                        <Resource name="TransactionManager" auth="Container" type="javax.transaction.TransactionManager"        factory="bitronix.tm.BitronixTransactionManagerObjectFactory" />

                               

                        <Resource name="TransactionSynchronizationRegistry" auth="Container" type="javax.transaction.TransactionSynchronizationRegistry"        factory="bitronix.tm.BitronixTransactionSynchronizationRegistryObjectFactory" />

                         

                         

                        jar files:

                        btm-2.1.1.jar

                        btm-tomcat55-lifecycle.jar

                        geronimo-jta_1.1_spec-1.1.1.jar

                        geronimo-jms_1.1_spec-1.1.1.jar

                        slf4j-jdk14-1.6.1.jar

                        slf4j-api-1.6.1.jar

                        jta.jar

                         


                        Please let me know if your looking for any other information.

                         

                        Note: My persistence related issue is still not being resolved, also let me know if I need to do any modifications related to that configuration also.

                         

                         

                        Thanks,

                        • 9. Re: problems using jbpm5 integrated with oracle and tomcat
                          salaboy21

                          Ok, but changing to the bitronix for tomcat7, what exception are you getting now?

                          Because re reading this thread again I found that the original exception was:

                          org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Could not initialize stateful knowledge session: No Persistence provider for EntityManager named org.jbpm.persistence.jpa

                           

                          And that's because inside your persistence XML file you define the org.jbpm.task persistence unit.

                           

                          Cheers