6 Replies Latest reply on Apr 24, 2007 1:02 PM by jcv

    Problem using mysql

    jcv

      Hi, i've followed the steps to user mysql instead of hypersonic, i can upload process, and work with them, but i'm keep getting this error:

      13:13:49,906 WARN [JDBCExceptionReporter] SQL Error: 1064, SQLState: 42000
      13:13:49,906 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDAT' at line 1
      13:13:49,906 ERROR [JobSession] org.hibernate.exception.SQLGrammarException: could not execute query
      13:13:49,906 ERROR [JobExecutorThread] exception in job executor thread. waiting 40000 milliseconds
      org.jbpm.JbpmException: couldn't get acquirable jobs
       at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:44)
       at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:111)
       at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56)
      Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.loader.Loader.doList(Loader.java:2147)
       at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
       at org.hibernate.loader.Loader.list(Loader.java:2023)
       at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
       at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
       at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
       at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
       at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
       at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:780)
       at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:40)
       ... 2 more
      Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDAT' at line 1
       at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
       at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2941)
       at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1623)
       at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1715)
       at com.mysql.jdbc.Connection.execSQL(Connection.java:3249)
       at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1268)
       at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1403)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
       at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1668)
       at org.hibernate.loader.Loader.doQuery(Loader.java:662)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.doList(Loader.java:2144)
       ... 11 more
      


      any hints on why is this happening?

        • 1. Re: Problem using mysql
          mputz

          Check your db schema if there is a JBPM_JOB table.

          If you upgrade from 3.1 to 3.2 look into the release.notes.html of the 3.2 package to see the necessary db schema updates.

          Regards, Martin

          • 2. Re: Problem using mysql
            jcv

            JBPM_JOB table do exists.

            I started a fresh 3.2 instalation on top of JBoss 4.0.5.GA

            I think i need to insert a default data to the job's table, but i'm not sure about it.

            • 3. Re: Problem using mysql
              ricardomarques

              which sql script are you using to create the database? there a script for mysql 5 on jboss wiki, i guess that one that comes width jbpm 3.2 doesn't work very well.

              • 4. Re: Problem using mysql
                jcv

                I found my error, but i dont know howto solve it.
                The problem is that hibernate is generation this query

                select top ? job0_.ID_ as ID1_26_, job0_.VERSION_ as VERSION3_26_, job0_.DUEDATE_ as DUEDATE4_26_, job0_.PROCESSINSTANCE_ as PROCESSI5_26_, job0_.TOKEN_ as TOKEN6_26_, job0_.TASKINSTANCE_ as TASKINST7_26_, job0_.ISSUSPENDED_ as ISSUSPEN8_26_, job0_.ISEXCLUSIVE_ as ISEXCLUS9_26_, job0_.LOCKOWNER_ as LOCKOWNER10_26_, job0_.LOCKTIME_ as LOCKTIME11_26_, job0_.EXCEPTION_ as EXCEPTION12_26_, job0_.RETRIES_ as RETRIES13_26_, job0_.NAME_ as NAME14_26_, job0_.REPEAT_ as REPEAT15_26_, job0_.TRANSITIONNAME_ as TRANSIT16_26_, job0_.ACTION_ as ACTION17_26_, job0_.GRAPHELEMENTTYPE_ as GRAPHEL18_26_, job0_.GRAPHELEMENT_ as GRAPHEL19_26_, job0_.NODE_ as NODE20_26_, job0_.CLASS_ as CLASS2_26_ from JBPM_JOB job0_ where (job0_.LOCKOWNER_ is null or job0_.LOCKOWNER_=?) and job0_.RETRIES_>0 and job0_.DUEDATE_<=? and job0_.ISSUSPENDED_<>1 order by job0_.DUEDATE_ asc
                


                and MySQL doenst use SELECT TOP.

                I've already changed WEB-INF/classes/hibernate.cfg.xml and add
                <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
                

                where else do i need to change it??

                • 5. Re: Problem using mysql
                  ricardomarques

                  look at this: http://wiki.jboss.org/wiki/Wiki.jsp?page=JbpmOnTomcat

                  I've followed this tutorial and i have everything except the realm autentication working

                  • 6. Re: Problem using mysql
                    jcv

                    My error, i had an old jbpm application throwing that error, no the one that i was working on now. :P :P