AnsweredAssumed Answered

Problem connecting to H2 database

Question asked by koteswarrao on Mar 16, 2011
Latest reply on Mar 16, 2011 by koteswarrao
hi all

i am trying to connect to h2 database from my acitiviti application program without using apache or any other(simply to say, as a standalone system). i implemented one sample application which deployes "start——>user task——->end". when i tried to deploy this workflow i am getting following error. can anybody please clarify on this. persistence is my main concern(for my project).

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:487)
   at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:851)
   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:233)
   at com.sample.activiti.MainClass.main(MainClass.java:52)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.h2.jdbc.JdbcSQLException: Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-132]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
   at org.h2.message.DbException.get(DbException.java:167)
   at org.h2.message.DbException.get(DbException.java:144)
   at org.h2.command.Parser.readTableOrView(Parser.java:4347)
   at org.h2.command.Parser.readTableFilter(Parser.java:1001)
   at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1529)
   at org.h2.command.Parser.parseSelectSimple(Parser.java:1626)
   at org.h2.command.Parser.parseSelectSub(Parser.java:1523)
   at org.h2.command.Parser.parseSelectUnion(Parser.java:1368)
   at org.h2.command.Parser.parseSelect(Parser.java:1356)
   at org.h2.command.Parser.parsePrepared(Parser.java:395)
   at org.h2.command.Parser.parse(Parser.java:278)
   at org.h2.command.Parser.parse(Parser.java:250)
   at org.h2.command.Parser.prepareCommand(Parser.java:222)
   at org.h2.engine.Session.prepareLocal(Session.java:420)
   at org.h2.server.TcpServerThread.process(TcpServerThread.java:224)
   at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
   at java.lang.Thread.run(Unknown Source)

### The error may exist in org/activiti/db/ibatis/engine.mapping.xml
### The error may involve org.activiti.persistence.selectDbSchemaVersion
### The error occurred while executing a query
### SQL: select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version'
### Cause: org.h2.jdbc.JdbcSQLException: Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-132]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
   at org.h2.message.DbException.get(DbException.java:167)
   at org.h2.message.DbException.get(DbException.java:144)
   at org.h2.command.Parser.readTableOrView(Parser.java:4347)
   at org.h2.command.Parser.readTableFilter(Parser.java:1001)
   at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1529)
   at org.h2.command.Parser.parseSelectSimple(Parser.java:1626)
   at org.h2.command.Parser.parseSelectSub(Parser.java:1523)
   at org.h2.command.Parser.parseSelectUnion(Parser.java:1368)
   at org.h2.command.Parser.parseSelect(Parser.java:1356)
   at org.h2.command.Parser.parsePrepared(Parser.java:395)
   at org.h2.command.Parser.parse(Parser.java:278)
   at org.h2.command.Parser.parse(Parser.java:250)
   at org.h2.command.Parser.prepareCommand(Parser.java:222)
   at org.h2.engine.Session.prepareLocal(Session.java:420)
   at org.h2.server.TcpServerThread.process(TcpServerThread.java:224)
   at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
   at java.lang.Thread.run(Unknown Source)

   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:38)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:33)
   at org.activiti.engine.impl.db.DbSqlSession.getDbVersion(DbSqlSession.java:509)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:445)
   … 8 more
Caused by: org.h2.jdbc.JdbcSQLException: Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-132]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
   at org.h2.message.DbException.get(DbException.java:167)
   at org.h2.message.DbException.get(DbException.java:144)
   at org.h2.command.Parser.readTableOrView(Parser.java:4347)
   at org.h2.command.Parser.readTableFilter(Parser.java:1001)
   at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1529)
   at org.h2.command.Parser.parseSelectSimple(Parser.java:1626)
   at org.h2.command.Parser.parseSelectSub(Parser.java:1523)
   at org.h2.command.Parser.parseSelectUnion(Parser.java:1368)
   at org.h2.command.Parser.parseSelect(Parser.java:1356)
   at org.h2.command.Parser.parsePrepared(Parser.java:395)
   at org.h2.command.Parser.parse(Parser.java:278)
   at org.h2.command.Parser.parse(Parser.java:250)
   at org.h2.command.Parser.prepareCommand(Parser.java:222)
   at org.h2.engine.Session.prepareLocal(Session.java:420)
   at org.h2.server.TcpServerThread.process(TcpServerThread.java:224)
   at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
   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:48)
   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:225)
   at $Proxy0.prepareStatement(Unknown Source)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:50)
   at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:64)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:39)
   at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:55)
   at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:40)
   at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:94)
   at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59)
   … 13 more
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:487)
   at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:851)
   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:233)
   at com.sample.activiti.MainClass.main(MainClass.java:52)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.h2.jdbc.JdbcSQLException: Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-132]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
   at org.h2.message.DbException.get(DbException.java:167)
   at org.h2.message.DbException.get(DbException.java:144)
   at org.h2.command.Parser.readTableOrView(Parser.java:4347)
   at org.h2.command.Parser.readTableFilter(Parser.java:1001)
   at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1529)
   at org.h2.command.Parser.parseSelectSimple(Parser.java:1626)
   at org.h2.command.Parser.parseSelectSub(Parser.java:1523)
   at org.h2.command.Parser.parseSelectUnion(Parser.java:1368)
   at org.h2.command.Parser.parseSelect(Parser.java:1356)
   at org.h2.command.Parser.parsePrepared(Parser.java:395)
   at org.h2.command.Parser.parse(Parser.java:278)
   at org.h2.command.Parser.parse(Parser.java:250)
   at org.h2.command.Parser.prepareCommand(Parser.java:222)
   at org.h2.engine.Session.prepareLocal(Session.java:420)
   at org.h2.server.TcpServerThread.process(TcpServerThread.java:224)
   at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
   at java.lang.Thread.run(Unknown Source)

### The error may exist in org/activiti/db/ibatis/engine.mapping.xml
### The error may involve org.activiti.persistence.selectDbSchemaVersion
### The error occurred while executing a query
### SQL: select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version'
### Cause: org.h2.jdbc.JdbcSQLException: Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-132]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
   at org.h2.message.DbException.get(DbException.java:167)
   at org.h2.message.DbException.get(DbException.java:144)
   at org.h2.command.Parser.readTableOrView(Parser.java:4347)
   at org.h2.command.Parser.readTableFilter(Parser.java:1001)
   at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1529)
   at org.h2.command.Parser.parseSelectSimple(Parser.java:1626)
   at org.h2.command.Parser.parseSelectSub(Parser.java:1523)
   at org.h2.command.Parser.parseSelectUnion(Parser.java:1368)
   at org.h2.command.Parser.parseSelect(Parser.java:1356)
   at org.h2.command.Parser.parsePrepared(Parser.java:395)
   at org.h2.command.Parser.parse(Parser.java:278)
   at org.h2.command.Parser.parse(Parser.java:250)
   at org.h2.command.Parser.prepareCommand(Parser.java:222)
   at org.h2.engine.Session.prepareLocal(Session.java:420)
   at org.h2.server.TcpServerThread.process(TcpServerThread.java:224)
   at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
   at java.lang.Thread.run(Unknown Source)

   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:38)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:33)
   at org.activiti.engine.impl.db.DbSqlSession.getDbVersion(DbSqlSession.java:509)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:445)
   … 8 more
Caused by: org.h2.jdbc.JdbcSQLException: Table "ACT_GE_PROPERTY" not found; SQL statement:
select VALUE_ from ACT_GE_PROPERTY where NAME_ = 'schema.version' [42102-132]
   at org.h2.message.DbException.getJdbcSQLException(DbException.java:316)
   at org.h2.message.DbException.get(DbException.java:167)
   at org.h2.message.DbException.get(DbException.java:144)
   at org.h2.command.Parser.readTableOrView(Parser.java:4347)
   at org.h2.command.Parser.readTableFilter(Parser.java:1001)
   at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1529)
   at org.h2.command.Parser.parseSelectSimple(Parser.java:1626)
   at org.h2.command.Parser.parseSelectSub(Parser.java:1523)
   at org.h2.command.Parser.parseSelectUnion(Parser.java:1368)
   at org.h2.command.Parser.parseSelect(Parser.java:1356)
   at org.h2.command.Parser.parsePrepared(Parser.java:395)
   at org.h2.command.Parser.parse(Parser.java:278)
   at org.h2.command.Parser.parse(Parser.java:250)
   at org.h2.command.Parser.prepareCommand(Parser.java:222)
   at org.h2.engine.Session.prepareLocal(Session.java:420)
   at org.h2.server.TcpServerThread.process(TcpServerThread.java:224)
   at org.h2.server.TcpServerThread.run(TcpServerThread.java:135)
   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:48)
   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:225)
   at $Proxy0.prepareStatement(Unknown Source)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.instantiateStatement(PreparedStatementHandler.java:50)
   at org.apache.ibatis.executor.statement.BaseStatementHandler.prepare(BaseStatementHandler.java:64)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.prepare(RoutingStatementHandler.java:39)
   at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:55)
   at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:40)
   at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:94)
   at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:59)
   … 13 more

Outcomes