AnsweredAssumed Answered

Missing DB column after migration to Activiti 5.11

Question asked by mmaker1234 on Dec 18, 2012
Latest reply on Jan 4, 2013 by mmaker1234
Hello Activiti developers,

I just migrated from Activiti 5.10 to 5.11. I started my application once with parameter databaseSchemaUpdate=true  (then turned the parameter value back to "false") therefore the DB schema should be upgraded. No errors were noticed during the upgrade. Currently the DB properties info looks like
schema.version   5.11
schema.history   create(5.7) upgrade(5.7->5.8) upgrade(5.8->5.9) upgrade(5.9->5.9-SNAPSHOT) upgrade(5.9-SNAPSHOT->5.10) upgrade(5.10->5.11-SNAPSHOT) upgrade(5.11-SNAPSHOT->5.11)

"5.x-SNAPSHOT" refers to Activiti source code snapshot downloaded shortly (a week or two) after the release of 5.x
Unfortunately, when I now try to call
      ManagementService service = processEngine.getManagementService();
     
      job = service.createJobQuery().jobId( jobId ).singleResult();
      if(job == null) {
        log("Can not find a job with ID " + jobId);
      } else {
        service.executeJob( job.getId() );
      }
, I receive the following error:

Dec 18, 2012 11:05:43 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLException: ORA-00904: "PROC_DEF_ID_": invalid identifier

### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.insertMessage-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_JOB (             ID_,              REV_,              TYPE_,             LOCK_OWNER_,              LOCK_EXP_TIME_,             EXCLUSIVE_,             EXECUTION_ID_,              PROCESS_INSTANCE_ID_,             PROC_DEF_ID_,             RETRIES_,              EXCEPTION_STACK_ID_,             EXCEPTION_MSG_,             HANDLER_TYPE_,             HANDLER_CFG_)     values (?,             1,             'message',             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?     )
### Cause: java.sql.SQLException: ORA-00904: "PROC_DEF_ID_": invalid identifier

    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
    at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:632)
    at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:459)
    at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:167)
    at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:114)
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:69)
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
    at org.activiti.engine.impl.ManagementServiceImpl.executeJob(ManagementServiceImpl.java:57)
    at org.activiti.engine.impl.ant.ExecuteJob.execute(ExecuteJob.java:38)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at ise.antelope.tasks.IfTask.doIf(IfTask.java:298)
    at ise.antelope.tasks.IfTask.execute(IfTask.java:272)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:62)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:394)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at ise.antelope.tasks.Case.execute(Case.java:151)
    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 org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at ise.antelope.tasks.SwitchTask.execute(SwitchTask.java:127)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at ise.antelope.tasks.Repeat.repeatTasks(Repeat.java:302)
    at ise.antelope.tasks.Repeat.execute(Repeat.java:265)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
    at org.apache.tools.ant.Main.runBuild(Main.java:758)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.sql.SQLException: ORA-00904: "PROC_DEF_ID_": invalid identifier

    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:212)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:951)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1159)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3389)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
    at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
    at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
    at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
    … 83 more
Job with ID 68322 can not be executed due to the following problem: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: java.sql.SQLException: ORA-00904: "PROC_DEF_ID_": invalid identifier

### The error may involve org.activiti.engine.impl.persistence.entity.JobEntity.insertMessage-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_JOB (             ID_,              REV_,              TYPE_,             LOCK_OWNER_,              LOCK_EXP_TIME_,             EXCLUSIVE_,             EXECUTION_ID_,              PROCESS_INSTANCE_ID_,             PROC_DEF_ID_,             RETRIES_,              EXCEPTION_STACK_ID_,             EXCEPTION_MSG_,             HANDLER_TYPE_,             HANDLER_CFG_)     values (?,             1,             'message',             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?,             ?     )
### Cause: java.sql.SQLException: ORA-00904: "PROC_DEF_ID_": invalid identifier
Please note that the job was created while version 5.10 was running.

Any ideas what might went wrong and how to fix it?

Outcomes