AnsweredAssumed Answered

Couldn't upgrade db schema ??

Question asked by bhj2 on Jul 4, 2011
Latest reply on Jul 11, 2011 by jbarrez
Hello,

I was using activiti 5.4 with my own vaadin explorer and mysql as db. It was working fine.

Then I decided to change to the last version (5.6). I compiled my project, deployed it on my glassfish server and started using my app. It was also working fine. BUT when I redeployed my project and tried to log in, i had the following exception:

[#|2011-07-04T16:29:18.569+0200|SEVERE|glassfish3.1|org.activiti.engine.impl.db.DbSqlSession|_ThreadID=53;_ThreadName=Thread-1;|problem during schema upgrade, statement 'alter table ACT_RU_TASK
add PARENT_TASK_ID_ varchar(64)
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'PARENT_TASK_ID_'
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
   at com.mysql.jdbc.Util.getInstance(Util.java:386)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2569)
   at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:813)
   at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:656)
   at sun.reflect.GeneratedMethodAccessor1077.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.ibatis.logging.jdbc.StatementLogger.invoke(StatementLogger.java:41)
   at $Proxy252.execute(Unknown Source)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:787)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:740)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpgrade(DbSqlSession.java:719)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:637)
   at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:872)
   at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:77)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:280)
   at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:177)
   at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:150)
   at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:88)
   at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:207)
   at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:200)
   at ch.glue.egovrunner.explorer.ui.login.LoginPresenter.attemptLogin(LoginPresenter.java:36)
   at ch.glue.egovrunner.explorer.ui.login.LoginWindowImpl$1.onLogin(LoginWindowImpl.java:79)
   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:490)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:162)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1166)
   at com.vaadin.ui.LoginForm$2.handleParameters(LoginForm.java:104)
   at com.vaadin.ui.Window.handleParameters(Window.java:496)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:510)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
   at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
   at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
   at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
   at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:662)
|#]

[#|2011-07-04T16:29:18.570+0200|SEVERE|glassfish3.1|org.activiti.engine.impl.interceptor.CommandContext|_ThreadID=53;_ThreadName=Thread-1;|Error while closing command context
org.activiti.engine.ActivitiException: couldn't upgrade db schema: alter table ACT_RU_TASK
add PARENT_TASK_ID_ varchar(64)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:813)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:740)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpgrade(DbSqlSession.java:719)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:637)
   at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:872)
   at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:77)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:280)
   at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:177)
   at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:150)
   at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:88)
   at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:207)
   at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:200)
   at ch.glue.egovrunner.explorer.ui.login.LoginPresenter.attemptLogin(LoginPresenter.java:36)
   at ch.glue.egovrunner.explorer.ui.login.LoginWindowImpl$1.onLogin(LoginWindowImpl.java:79)
   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:490)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:162)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1166)
   at com.vaadin.ui.LoginForm$2.handleParameters(LoginForm.java:104)
   at com.vaadin.ui.Window.handleParameters(Window.java:496)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:510)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
   at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
   at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
   at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
   at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'PARENT_TASK_ID_'
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
   at com.mysql.jdbc.Util.getInstance(Util.java:386)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2569)
   at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:813)
   at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:656)
   at sun.reflect.GeneratedMethodAccessor1077.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.ibatis.logging.jdbc.StatementLogger.invoke(StatementLogger.java:41)
   at $Proxy252.execute(Unknown Source)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:787)
   … 53 more
|#]

[#|2011-07-04T16:29:18.581+0200|SEVERE|glassfish3.1|org.activiti.engine.ProcessEngines|_ThreadID=53;_ThreadName=Thread-1;|Exception while initializing process engine :couldn't upgrade db schema: alter table ACT_RU_TASK
add PARENT_TASK_ID_ varchar(64)
org.activiti.engine.ActivitiException: couldn't upgrade db schema: alter table ACT_RU_TASK
add PARENT_TASK_ID_ varchar(64)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:813)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:740)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpgrade(DbSqlSession.java:719)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaUpdate(DbSqlSession.java:637)
   at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:872)
   at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:77)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:280)
   at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:177)
   at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:150)
   at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:88)
   at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:207)
   at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:200)
   at ch.glue.egovrunner.explorer.ui.login.LoginPresenter.attemptLogin(LoginPresenter.java:36)
   at ch.glue.egovrunner.explorer.ui.login.LoginWindowImpl$1.onLogin(LoginWindowImpl.java:79)
   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:490)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:162)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1166)
   at com.vaadin.ui.LoginForm$2.handleParameters(LoginForm.java:104)
   at com.vaadin.ui.Window.handleParameters(Window.java:496)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:510)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
   at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
   at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
   at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
   at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
   at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
   at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
   at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
   at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
   at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
   at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
   at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
   at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
   at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
   at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
   at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
   at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
   at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
   at java.lang.Thread.run(Thread.java:662)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Duplicate column name 'PARENT_TASK_ID_'
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
   at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
   at com.mysql.jdbc.Util.getInstance(Util.java:386)
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
   at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
   at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
   at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
   at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2569)
   at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:813)
   at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:656)
   at sun.reflect.GeneratedMethodAccessor1077.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.ibatis.logging.jdbc.StatementLogger.invoke(StatementLogger.java:41)
   at $Proxy252.execute(Unknown Source)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:787)
   … 53 more
|#]


If remove my database, create it and redeploy my project, it works again. But as soon as I deploy it for the second time, the exceptions occurs.

And if I re use version 5.4, everything is fine again.

Do you have an idea?

Outcomes