9 Replies Latest reply on Jul 31, 2007 7:55 AM by David Roberts

    problem using jbpm with tomcat 5.5 and mysql 5.0

    bcs ppl Newbie

      i tried setting up jbpm on tomcat 5.5 using mysql 5.0 as the database but encountered some problem. i've read the wiki and did as instructed but i still couldnt get it right. did i do sth wrong? here is the things that i did

      1. copied the jbpm-console.war from the deploy folder to the tomcat webapps folder

      2. made these changes to hibernate.cfg.xml


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

      <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="hibernate.connection.url">jdbc:mysql://localhost:3307/jbpm</property>
      <property name="hibernate.connection.username">root</property>
      <property name="hibernate.connection.password">admin</property>

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


      3. add this to $CATALINA_HOME/conf/Catalina/localhost

      <Context>
      <Realm className="org.apache.catalina.realm.JDBCRealm"
      driverName="com.mysql.jdbc.Driver"
      connectionURL="jdbc:mysql://localhost:3307/jbpm"
      connectionName="root"
      connectionPassword="admin"
      userTable="JBPM_ID_USER"
      userNameCol="NAME_"
      userCredCol="PASSWORD_"
      userRoleTable="JBPM_ID_MEMBERSHIP"
      roleNameCol="ROLE_" />
      </Context>


      4. updated the database with these

      UPDATE jbpm_id_membership j, jbpm_id_user u
      SET j.NAME_ = u.NAME_
      WHERE j.USER_ = u.ID_

      UPDATE jbpm_id_membership j, jbpm_id_group g
      SET j.ROLE_ = g.NAME_
      WHERE j.GROUP_ = g.ID_


      5. copied all the jars from jbpm-jpdl-3.2.GA\lib\*.jar to my $CATALINA_HOME\webapps\jbpm-console\WEB-INF\lib

      the mysql connector is in my tomcat common lib folder
      i'm using port 3307 for mysql and jbpm is the database name i've created in mysql

      did i left out something???

        • 1. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
          bcs ppl Newbie

          sory, forgot it will strip off the tags, the entries i put in jbpm-console.xml is this

          Context>
          Realm className="org.apache.catalina.realm.JDBCRealm"
          driverName="com.mysql.jdbc.Driver"
          connectionURL="jdbc:mysql://localhost:3307/jbpm"
          connectionName="root"
          connectionPassword="admin"
          userTable="JBPM_ID_USER"
          userNameCol="NAME_"
          userCredCol="PASSWORD_"
          userRoleTable="JBPM_ID_MEMBERSHIP"
          roleNameCol="ROLE_" />
          /Context>

          • 2. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
            Martin Weiler Apprentice

            >> but encountered some problem.

            what kind of problems? any actual errors you can share with us?

            >> 5. copied all the jars from jbpm-jpdl-3.2.GA\lib\*.jar to my $CATALINA_HOME\webapps\jbpm-console\WEB-INF\lib

            that might not be all needed. I'd recommend to start off by executing

            ant customize.console.for.tomcat

            in the jbpm-jpdl-3.2.GA/deploy directory.

            (please try using the [ code ] [ /code ] elements -without the blanks- next time you want to share some code - and there is also a preview ;-))

            Regards, Martin




            • 3. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
              anders elo Newbie

              I also have an issue with the configuration. Apparently according to the catalina logs, the datasource for the jdbc connection is undefined/missing.

              SEVERE: exception in job executor thread. waiting 2560000 milliseconds
              org.hibernate.HibernateException: Could not find datasource
               at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
               at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
               at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
               at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:397)
               at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
               at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
               at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
               at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
               at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94)
               at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
               at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:352)
               at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
               at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109)
               at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56)
              Caused by: javax.naming.NameNotFoundException: Name jbpmDS is not bound in this Context
              


              • 4. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
                Martin Weiler Apprentice

                @Anders,

                apparently you have a configuration where the server is trying to establish a connection to the db defined by the 'jbpmDS' datasource. This only works inside JBoss, but not if you are deploying to a standalone Tomcat instance.

                In hibernate.cfg.xml, delete this


                <property name="hibernate.connection.datasource">java:/JbpmDS</property>


                and instead use a configuration similar to this:

                <!-- JDBC connection properties (begin) -->
                 <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                 <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpm32</property>
                 <property name="hibernate.connection.username">jbossjbpm</property>
                 <property name="hibernate.connection.password">jbossjbpm</property>
                 <!-- JDBC connection properties (end) -->


                See also: http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmOnTomcat

                Regards, Martin

                • 5. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
                  anders elo Newbie

                  Thanks Martin, for pinpointing that. The next issue I'm facing is problem with the JDBC connection. If you know the apparent reason for that aswell, let me know :)


                  SEVERE: exception in job executor thread. waiting 640000 milliseconds
                  java.lang.UnsupportedOperationException: The user must supply a JDBC connection
                  at org.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:30)
                  at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:417)
                  at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
                  at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
                  at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
                  at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
                  at org.jbpm.persistence.db.DbPersistenceService.beginTransaction(DbPersistenceService.java:130)
                  at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:122)
                  at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:352)
                  at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
                  at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109)
                  at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56)


                  The mysqldb is up and responding on port 3306, the Connector/J library has been deployed into $CATALINA_HOME/lib.

                  ...I'll submit a solution here if I find the cause...


                  • 6. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
                    Martin Weiler Apprentice

                    Anders, I think there is still something wrong with your configuration - if you post the content of hibernate.cfg.xml here I can have a look - sometimes a second set of eyes is helpful with such issues ;-)

                    Regards, Martin

                    • 7. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
                      anders elo Newbie

                      Thanks for the effort, I was actually planning to give up for today.

                      I hope you don't mind that I only paste the top of the file since the rest has been untouched.

                      <?xml version='1.0' encoding='utf-8'?>
                      
                      <!DOCTYPE hibernate-configuration PUBLIC
                       "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
                      
                      <hibernate-configuration>
                       <session-factory>
                      
                       <!-- hibernate dialect -->
                       <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                      
                       <!-- JDBC connection properties (begin) ===
                       <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
                       <property name="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306/jbpm32</property>
                       <property name="hibernate.connection.username">jbossjbpm</property>
                       <property name="hibernate.connection.password">jbossjbpm</property>
                       ==== JDBC connection properties (end) -->
                      
                       <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
                      
                       <!-- JTA transaction properties (begin) ===
                       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
                       <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
                       ==== JTA transaction properties (end) -->
                      
                       <!-- CMT transaction properties (begin) ===
                       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
                       <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
                       ==== CMT transaction properties (end) -->
                      
                       <!-- logging properties (begin) ===
                       <property name="hibernate.show_sql">true</property>
                       <property name="hibernate.format_sql">true</property>
                       <property name="hibernate.use_sql_comments">true</property>
                       ==== logging properties (end) -->
                      ...
                      
                      


                      • 8. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
                        anders elo Newbie

                        I know see myself that I've messed up the config and left the comments remaining there. Of course it didn't work. :)

                        Anyways, thanks again Martin!

                        • 9. Re: problem using jbpm with tomcat 5.5 and mysql 5.0
                          David Roberts Apprentice

                          Don't worry, I just did the exact same thing, and spent an hour trying to figure it out :) Silly me.