3 Replies Latest reply on May 25, 2011 6:50 PM by siueramki

    jBPM 4.4 - unable to run examples

    Parul Vipparthi Newbie

      Hello

       

      I am trying to run examples from jBPM 4.4 on winxp, mysql5.1 but i get this exception for all examples

       

      9:31:48,106 SEV | [JDBCExceptionReporter] Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))
      ### EXCEPTION ###########################################
      19:31:48,106 SEV | [AbstractFlushingEventListener] Could not synchronize database state with session
      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)
      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
      at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1589)
      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessDefinitionHistory(DbSessionImpl.java:113)
      at org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd.execute(DeleteDeploymentCmd.java:76)
      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
      at org.jbpm.pvm.internal.repository.RepositoryServiceImpl.deleteDeploymentCascade(RepositoryServiceImpl.java:71)
      at org.jbpm.examples.PrintHelloWorldTest.tearDown(PrintHelloWorldTest.java:23)
      at junit.framework.TestCase.runBare(TestCase.java:136)
      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:120)
      at junit.framework.TestSuite.runTest(TestSuite.java:230)
      at junit.framework.TestSuite.run(TestSuite.java:225)
      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:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)
      ... 33 more
      ### EXCEPTION ###########################################
      ### EXCEPTION ###########################################
      19:31:48,122 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd@198c6f3
      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)
      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
      at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)
      at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1589)
      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessDefinitionHistory(DbSessionImpl.java:113)
      at org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd.execute(DeleteDeploymentCmd.java:76)
      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)
      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
      at org.jbpm.pvm.internal.repository.RepositoryServiceImpl.deleteDeploymentCascade(RepositoryServiceImpl.java:71)
      at org.jbpm.examples.PrintHelloWorldTest.tearDown(PrintHelloWorldTest.java:23)
      at junit.framework.TestCase.runBare(TestCase.java:136)
      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:120)
      at junit.framework.TestSuite.runTest(TestSuite.java:230)
      at junit.framework.TestSuite.run(TestSuite.java:225)
      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:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)
      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)
      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)
      ... 33 more
      ### EXCEPTION ###########################################
      19:31:48,216 FIN | [HibernateSessionResource] ----- rolling back hibernate tx 19762893 -----------------------------------------------------

      9:31:48,106 SEV | [JDBCExceptionReporter] Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))

      ### EXCEPTION ###########################################

      19:31:48,106 SEV | [AbstractFlushingEventListener] Could not synchronize database state with session

      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]

      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)

      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)

      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)

      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)

      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)

      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

      at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)

      at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)

      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1589)

      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)

      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessDefinitionHistory(DbSessionImpl.java:113)

      at org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd.execute(DeleteDeploymentCmd.java:76)

      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)

      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)

      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

      at org.jbpm.pvm.internal.repository.RepositoryServiceImpl.deleteDeploymentCascade(RepositoryServiceImpl.java:71)

      at org.jbpm.examples.PrintHelloWorldTest.tearDown(PrintHelloWorldTest.java:23)

      at junit.framework.TestCase.runBare(TestCase.java:136)

      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:120)

      at junit.framework.TestSuite.runTest(TestSuite.java:230)

      at junit.framework.TestSuite.run(TestSuite.java:225)

      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:467)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))

      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)

      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)

      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)

      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)

      at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)

      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)

      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)

      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)

      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)

      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)

      ... 33 more

      ### EXCEPTION ###########################################

      ### EXCEPTION ###########################################

      19:31:48,122 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd@198c6f3

      org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]

      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)

      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)

      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)

      at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)

      at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

      at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)

      at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

      at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:64)

      at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)

      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1589)

      at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)

      at org.jbpm.pvm.internal.hibernate.DbSessionImpl.deleteProcessDefinitionHistory(DbSessionImpl.java:113)

      at org.jbpm.pvm.internal.cmd.DeleteDeploymentCmd.execute(DeleteDeploymentCmd.java:76)

      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)

      at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)

      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)

      at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)

      at org.jbpm.pvm.internal.repository.RepositoryServiceImpl.deleteDeploymentCascade(RepositoryServiceImpl.java:71)

      at org.jbpm.examples.PrintHelloWorldTest.tearDown(PrintHelloWorldTest.java:23)

      at junit.framework.TestCase.runBare(TestCase.java:136)

      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:120)

      at junit.framework.TestSuite.runTest(TestSuite.java:230)

      at junit.framework.TestSuite.run(TestSuite.java:225)

      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:467)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`jbpmdb`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))

      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)

      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)

      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)

      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)

      at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)

      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)

      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1604)

      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1519)

      at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1504)

      at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)

      ... 33 more

      ### EXCEPTION ###########################################

      19:31:48,216 FIN | [HibernateSessionResource] ----- rolling back hibernate tx 19762893 -----------------------------------------------------

      Any help will be appreciated.
      Thank you

        • 1. Re: jBPM 4.4 - unable to run examples
          j040 p3d20 Newbie

          Hi,

           

          I'm getting the same error when running the following code

           

           

          String deploymentDbid = repositoryService.createDeployment().addResourceFromClasspath("sample-process.jpdl.xml").deploy();

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

          variables.put("content", "good");

          ProcessInstance processInstance = executionService.startProcessInstanceByKey("DecisionExpression", variables);

          log.info("Process reached state " + processInstance.getState());

           

          /*

          * this line produces the error

          */

          executionService.signalExecutionById(processInstance.getId());

           

           

          I'm using jbpm 4.3 and processInstance is a spring 2.5.6 auto-wired bean. Since I have also a JPA context for my application , aside from the hibernate context used by jbpm engine, I feared that this could somehow interfere with jbpm execution.

           

          Can someone please provide some insight into this ?

           

          ...

          Hibernate:
              /* delete one-to-many org.jbpm.pvm.internal.model.ExecutionImpl.variables */ update
                      JBPM4_VARIABLE
                  set
                      EXECUTION_=null,
                      KEY_=null
                  where
                      EXECUTION_=?
          Hibernate:
              /* delete org.jbpm.pvm.internal.type.variable.StringVariable */ delete
                  from
                      JBPM4_VARIABLE
                  where
                      DBID_=?
                      and DBVERSION_=?
          Hibernate:
              /* delete org.jbpm.pvm.internal.model.ExecutionImpl */ delete
                  from
                      JBPM4_EXECUTION
                  where
                      DBID_=?
                      and DBVERSION_=?
          15382 [http-8080-exec-2] WARN org.hibernate.util.JDBCExceptionReporter  - SQL Error: 1451, SQLState: 23000
          15382 [http-8080-exec-2] ERROR org.hibernate.util.JDBCExceptionReporter  - Cannot delete or update a parent row: a foreign key constraint fails (`jbpm`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))
          15388 [http-8080-exec-2] ERROR org.hibernate.event.def.AbstractFlushingEventListener  - Could not synchronize database state with session
          org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)
          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)
          at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)
          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)
          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
          at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135)
          at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:905)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:715)
          at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
          at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
          at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:55)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
          at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:84)
          at com.example.workflow.WorkflowApplication.execute(WorkflowApplication.java:69)
          at com.example.workflow.WorkflowApplication.access$0(WorkflowApplication.java:53)
          at com.example.workflow.WorkflowApplication$1.buttonClick(WorkflowApplication.java:45)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:487)
          at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
          at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1154)
          at com.vaadin.ui.Button.fireClick(Button.java:371)
          at com.vaadin.ui.Button.changeVariables(Button.java:193)
          at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1094)
          at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:590)
          at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:266)
          at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:476)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)

           

          Hibernate:

              /* delete one-to-many org.jbpm.pvm.internal.model.ExecutionImpl.variables */ update

                      JBPM4_VARIABLE

                  set

                      EXECUTION_=null,

                      KEY_=null

                  where

                      EXECUTION_=?

          Hibernate:

              /* delete org.jbpm.pvm.internal.type.variable.StringVariable */ delete

                  from

                      JBPM4_VARIABLE

                  where

                      DBID_=?

                      and DBVERSION_=?

          Hibernate:

              /* delete org.jbpm.pvm.internal.model.ExecutionImpl */ delete

                  from

                      JBPM4_EXECUTION

                  where

                      DBID_=?

                      and DBVERSION_=?

          15382 [http-8080-exec-2] WARN org.hibernate.util.JDBCExceptionReporter  - SQL Error: 1451, SQLState: 23000

          15382 [http-8080-exec-2] ERROR org.hibernate.util.JDBCExceptionReporter  - Cannot delete or update a parent row: a foreign key constraint fails (`jbpm`.`jbpm4_execution`, CONSTRAINT `FK_EXEC_INSTANCE` FOREIGN KEY (`INSTANCE_`) REFERENCES `jbpm4_execution` (`DBID_`))

          15388 [http-8080-exec-2] ERROR org.hibernate.event.def.AbstractFlushingEventListener  - Could not synchronize database state with session

          org.hibernate.exception.ConstraintViolationException: could not delete: [org.jbpm.pvm.internal.model.ExecutionImpl#7]

          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)

          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)

          at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)

          at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)

          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)

          at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)

          at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)

          at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)

          at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)

          at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135)

          at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72)

          at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:905)

          at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:715)

          at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)

          at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)

          at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:55)

          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)

          at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)

          at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)

          at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:84)

          at com.example.workflow.WorkflowApplication.execute(WorkflowApplication.java:69)

          at com.example.workflow.WorkflowApplication.access$0(WorkflowApplication.java:53)

          at com.example.workflow.WorkflowApplication$1.buttonClick(WorkflowApplication.java:45)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:487)

          at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)

          at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1154)

          at com.vaadin.ui.Button.fireClick(Button.java:371)

          at com.vaadin.ui.Button.changeVariables(Button.java:193)

          at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1094)

          at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:590)

          at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:266)

          at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:476)

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

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

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

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)

          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)

          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:619)

          • 2. Re: jBPM 4.4 - unable to run examples
            j040 p3d20 Newbie

            it seems that using

             

            hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

             

            resolves this

            • 3. Re: jBPM 4.4 - unable to run examples
              siueramki Newbie

              If I knew where you are, I'd just do whatever you ask of me. This error has been bugging the life out of me, and I've scoured through hundreds of messages and posts trying to figure out what the heck was wrong with my code. Thank you very very much. Your post literally SAVED me !!!