psagarna (11) [Avatar] Offline
#1
I have import the project bpm-examples generated by maven. I'm trying to run the second example (BookOrderTest.java) of chapter 1 and produce this error. I have add the property
<property name="databaseSchemaUpdate" value="true"/> in activiti activiti.cfg.xml, I have compile again and generate the eclipse project again and still the same error. Any help?

org.activiti.engine.ActivitiWrongDbException: version mismatch: activiti library version is '5.8', db version is 5.9 Hint: Set <property name="databaseSchemaUpdate" to value="true" or value="create-drop" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation >

Many thanks,

Regards,

Pablo.
tijs.rademakers (494) [Avatar] Offline
#2
Re: Example Chapter 1 BookOrderTest.java Test Case Exception
Yes I have to upgrade the examples to Activiti 5.9.
For now you can do this yourself by changing the Activiti version in the pom.xml of the project to 5.9

Best regards,

Tijs
psagarna (11) [Avatar] Offline
#3
Re: Example Chapter 1 BookOrderTest.java Test Case Exception
Yes, Thanks, I have put the example in other one and works.

Cheers.

Pablo.
micho187 (1) [Avatar] Offline
#4
Re: Example Chapter 1 BookOrderTest.java Test Case Exception
I upgrade the version from 5.9 to 5.10 in the pom.xml. After that, all is ok.

<properties>
<activiti-version>5.10</activiti-version>
<spring-version>3.0.5.RELEASE</spring-version>
<cxf-version>2.4.4</cxf-version>
<drools-version>5.3.0.Final</drools-version>
</properties>

Thanks for the information,


Message was edited by:
micho187
sversh71 (2) [Avatar] Offline
#5
Re: Example Chapter 1 BookOrderTest.java Test Case Exception
Hello, Tijs!

I get the same roblem but it's not solved by upgrading activiti version in pom file. I get the last source code from SVN, download and run H2 Database. On the second example (BookOrderTest.java) of chapter 1 I get the exception below. It's seems that activiti cannot create tables in DB at all. Is it problem of database? Should I create tables by hand?


21 jan 2014 11:11:29,971 [main] ERROR org.activiti.engine.impl.interceptor.CommandContext:138 - Error while closing command context
org.activiti.engine.ActivitiException: no activiti tables in db. set <property name="databaseSchemaUpdate" to value="true" or value="create-drop" (use create-drop for testing only!) in bean processEngineConfiguration in activiti.cfg.xml for automatic schema creation >
at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:719)
at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:1111)
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:61)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:76)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:372)
at org.bpmnwithactiviti.chapter1.BookOrderTest.startBookOrder(BookOrderTest.java:26)
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 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3smilie
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: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.h2.jdbc.JdbcSQLException: Таблица "ACT_GE_PROPERTY" не найдена
Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-175]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
at org.h2.message.DbException.get(DbException.java:172)
at org.h2.message.DbException.get(DbException.java:149)
at org.h2.command.Parser.readTableOrView(Parser.java:5071)
at org.h2.command.Parser.readTableFilter(Parser.java:118smilie
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1813)
at org.h2.command.Parser.parseSelectSimple(Parser.java:1921)
at org.h2.command.Parser.parseSelectSub(Parser.java:1807)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1631)
at org.h2.command.Parser.parseSelect(Parser.java:1619)
at org.h2.command.Parser.parsePrepared(Parser.java:426)
at org.h2.command.Parser.parse(Parser.java:29smilie
at org.h2.command.Parser.parse(Parser.java:270)
at org.h2.command.Parser.prepareCommand(Parser.java:235)
at org.h2.engine.Session.prepareLocal(Session.java:436)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:260)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:156)
at java.lang.Thread.run(Unknown Source)

### The error may exist in org/activiti/db/mapping/entity/Property.xml
### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntity.selectDbSchemaVersion
### The error occurred while executing a query
### SQL: select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version'
### Cause: org.h2.jdbc.JdbcSQLException: Таблица "ACT_GE_PROPERTY" не найдена
Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-175]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
at org.h2.message.DbException.get(DbException.java:172)
at org.h2.message.DbException.get(DbException.java:149)
at org.h2.command.Parser.readTableOrView(Parser.java:5071)
at org.h2.command.Parser.readTableFilter(Parser.java:118smilie
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1813)
at org.h2.command.Parser.parseSelectSimple(Parser.java:1921)
at org.h2.command.Parser.parseSelectSub(Parser.java:1807)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1631)
at org.h2.command.Parser.parseSelect(Parser.java:1619)
at org.h2.command.Parser.parsePrepared(Parser.java:426)
at org.h2.command.Parser.parse(Parser.java:29smilie
at org.h2.command.Parser.parse(Parser.java:270)
at org.h2.command.Parser.prepareCommand(Parser.java:235)
at org.h2.engine.Session.prepareLocal(Session.java:436)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:260)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:156)
at java.lang.Thread.run(Unknown Source)

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:59)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:54)
at org.activiti.engine.impl.db.DbSqlSession.getDbVersion(DbSqlSession.java:741)
at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:697)
... 30 more
Caused by: org.h2.jdbc.JdbcSQLException: Таблица "ACT_GE_PROPERTY" не найдена
Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-175]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
at org.h2.message.DbException.get(DbException.java:172)
at org.h2.message.DbException.get(DbException.java:149)
at org.h2.command.Parser.readTableOrView(Parser.java:5071)
at org.h2.command.Parser.readTableFilter(Parser.java:118smilie
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1813)
at org.h2.command.Parser.parseSelectSimple(Parser.java:1921)
at org.h2.command.Parser.parseSelectSub(Parser.java:1807)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1631)
at org.h2.command.Parser.parseSelect(Parser.java:1619)
at org.h2.command.Parser.parsePrepared(Parser.java:426)
at org.h2.command.Parser.parse(Parser.java:29smilie
at org.h2.command.Parser.parse(Parser.java:270)
at org.h2.command.Parser.prepareCommand(Parser.java:235)
at org.h2.engine.Session.prepareLocal(Session.java:436)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:260)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:156)
at java.lang.Thread.run(Unknown Source)

at org.h2.engine.SessionRemote.done(SessionRemote.java:505)
at org.h2.command.CommandRemote.prepare(CommandRemote.java:70)
at org.h2.command.CommandRemote.<init>(CommandRemote.java:4smilie
at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:401)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1070)
at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:71)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:233)
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 org.apache.ibatis.datasource.pooled.PooledConnection.invoke(PooledConnection.java:246)
at com.sun.proxy.$Proxy4.prepareStatement(Unknown Source)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:72)
at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:82)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:54)
at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:70)
at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101)
... 35 more


Thank you!
Regards, Sergei
sversh71 (2) [Avatar] Offline
#6
Re: Example Chapter 1 BookOrderTest.java Test Case Exception
Solved.

I just download the same version of activiti (5.12 in my case), run H2 before activiti running. Then all tables were created by activiti and test (BookOrderTest.java) passed.