1 Reply Latest reply on Dec 9, 2007 6:22 PM by Sara Rodríguez Dorrego

    Persitence problem

    Sara Rodríguez Dorrego Novice

      Hi!!

      I've configured jBPM to work wih MySQL. Now, I have a problem. When I want save the instance of a process it's thrown a exception that indicates that a table doesn't exist. But ... it isn't true! The table exist!! I think that maybe the hibernate.cfg file is wrong and I have to change something in it.

      Do anyone know the solution at this problem?

      Thanks


      00:07:35,265 [main] WARN JDBCExceptionReporter : SQL Error: -22, SQLState: S0002
      00:07:35,265 [main] ERROR JDBCExceptionReporter : Table not found in statement [insert into JBPM_TOKEN (ID_, VERSION_, NAME_, START_, END_, NODEENTER_, NEXTLOGINDEX_, ISABLETOREACTIVATEPARENT_, ISTERMINATIONIMPLICIT_, ISSUSPENDED_, LOCK_, NODE_, PROCESSINSTANCE_, PARENT_, SUBPROCESSINSTANCE_) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
      00:07:35,265 [main] DEBUG JbpmContext : closing jbpmContext org.jbpm.JbpmContext@fbb7cb
      00:07:35,265 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@db38a4
      00:07:35,265 [main] DEBUG DbPersistenceService : committing hibernate transaction org.hibernate.transaction.JDBCTransaction@1b83048
      00:07:35,281 [main] WARN JDBCExceptionReporter : SQL Error: -22, SQLState: S0002
      00:07:35,281 [main] ERROR JDBCExceptionReporter : Table not found in statement [insert into JBPM_MODULEINSTANCE (ID_, VERSION_, PROCESSINSTANCE_, CLASS_) values (null, ?, ?, 'C')]
      00:07:35,281 [main] ERROR DbPersistenceService : hibernate commit failed
      org.hibernate.exception.SQLGrammarException: could not insert: [org.jbpm.context.exe.ContextInstance]
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:40)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
       at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
       at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
       at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:256)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:214)
       at org.jbpm.svc.Services.close(Services.java:225)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at com.Ejemplo1.Test2.testEjemplo1Process(Test2.java:50)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: java.sql.SQLException: Table not found in statement [insert into JBPM_MODULEINSTANCE (ID_, VERSION_, PROCESSINSTANCE_, CLASS_) values (null, ?, ?, 'C')]
       at org.hsqldb.jdbc.Util.throwError(Unknown Source)
       at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
       at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
       at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:94)
       at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:30)
       ... 52 more
      00:07:35,281 [main] DEBUG DbPersistenceService : rolling back hibernate transaction
      00:07:35,281 [main] DEBUG DbPersistenceService : closing hibernate session
      00:07:35,281 [main] ERROR Services : problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: hibernate commit failed
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:219)
       at org.jbpm.svc.Services.close(Services.java:225)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at com.Ejemplo1.Test2.testEjemplo1Process(Test2.java:50)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       at junit.framework.TestResult$1.protect(TestResult.java:106)
       at junit.framework.TestResult.runProtected(TestResult.java:124)
       at junit.framework.TestResult.run(TestResult.java:109)
       at junit.framework.TestCase.run(TestCase.java:118)
       at junit.framework.TestSuite.runTest(TestSuite.java:208)
       at junit.framework.TestSuite.run(TestSuite.java:203)
       at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [org.jbpm.context.exe.ContextInstance]
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:40)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2158)
       at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2638)
       at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:48)
       at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
       at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:298)
       at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
       at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
       at org.jbpm.persistence.db.DbPersistenceService.commit(DbPersistenceService.java:256)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:214)
       ... 21 more
      Caused by: java.sql.SQLException: Table not found in statement [insert into JBPM_MODULEINSTANCE (ID_, VERSION_, PROCESSINSTANCE_, CLASS_) values (null, ?, ?, 'C')]
       at org.hsqldb.jdbc.Util.throwError(Unknown Source)
       at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
       at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
       at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505)
       at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:94)
       at org.hibernate.id.insert.AbstractSelectingDelegate.performInsert(AbstractSelectingDelegate.java:30)
       ... 52 more
      00:07:35,296 [main] DEBUG Services : closing service 'tx': org.jbpm.tx.TxService@58213c
      


        • 1. Re: Persitence problem
          Sara Rodríguez Dorrego Novice

          When the server starts also thrown an exception::

          2007-12-10 00:19:50,312 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select 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]
          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:1027)
           at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3376)
           at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3308)
           at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837)
           at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
           at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
           at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
           at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1888)
           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:1669)
           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:2145)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
           at org.hibernate.loader.Loader.list(Loader.java:2024)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
           at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:756)
           at org.jbpm.db.JobSession.getFirstAcquirableJob(JobSession.java:40)
           at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:114)