cancel
Showing results for 
Search instead for 
Did you mean: 

Exception starting Tomcat with Oracle DB in Activiti-5.0.rc1

gerry_fisher
Champ in-the-making
Champ in-the-making
OS: Windows XP
Activiti version: 5.0.rc1
Tomcat version: 6.0.29
Oracle version: 9.1
JDBC Driver version: 11.1.0.6.0 (ojdbc5.jar)

I have, after some tweaking of setup/build.xml, created a database, which I have named 'ACTIVITI', and populated the ACT_ID_GROUP, ACT_ID_MEMBERSHIP and ACT_ID_USER tables successfully.
However, Tomcat is throwing an exception when trying to deploy activiti-webapp-init. Here's a snippet of the console dump:


04-Nov-2010 12:07:40 org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory activiti-webapp-init
org.apache.ibatis.exceptions.PersistenceException:
### Error opening session.  Cause: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-132]
### The error may exist in org/activiti/db/ibatis/variable.mapping.xml
### The error occurred while processing mapper_resultMap[byteArrayResultMap_postgres]
### Cause: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-132]
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSessionFromDataSource(DefaultSqlSessionFactory.java:81)
        at org.apache.ibatis.session.defaults.DefaultSqlSessionFactory.openSession(DefaultSqlSessionFactory.java:40)
        at org.activiti.engine.impl.db.DbSqlSessionFactory.dbSchemaCheckVersion(DbSqlSessionFactory.java:229)
        at org.activiti.engine.impl.ProcessEngineImpl.performSchemaOperationsCreate(ProcessEngineImpl.java:102)
        at org.activiti.engine.impl.ProcessEngineImpl$1.execute(ProcessEngineImpl.java:70)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:36)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
        at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:68)
        at org.activiti.engine.impl.cfg.ProcessEngineConfiguration.buildProcessEngine(ProcessEngineConfiguration.java:302)
        at org.activiti.engine.ProcessEngineBuilder.buildProcessEngine(ProcessEngineBuilder.java:272)
        at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:150)
        at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:124)
        at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:83)
        at org.activiti.impl.servlet.listener.ProcessEnginesServletContextListener.contextInitialized(ProcessEnginesServletContextListener.java:30)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)

1. For a start, I'm running an Oracle database and so the exception is being thrown by an incorrect class - org.h2.jdbc.JdbcSQLException.
2. On line 5, the suggested error location, org/activiti/db/ibatis/variable.mapping.xml, is in activiti-engine-5.0.rc1.jar.

My guess is that iBatis is attempting to insert a record into a H2 table. My question is: How do I get the 'application' to work with Oracle instead?
Although I tweaked build.xml to integrate Oracle, I'm assuming that I haven't missed out any other changes since the source of the problem lies in activiti-engine-5.0.rc1.jar. I imagine that there are some hard-coded values in activiti-engine-5.0.rc1.jar that should instead be configurable.
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
When you call "ant demo.setup", a configuration-file is created, based on the build.properties in the $distro/setup folder. If you set the db property to oracle, and run demo.setup, everything should work out of the box (after having installed oracle jdbc driver in maven, see userguide)

If you are not using the demo setup, you can configure the database in the file activiti.cfg.xml, which is located in the activiti-cfg.jar, which should be somewhere on your classpath, depending on the environnement:
<?xml version="1.0" encoding="UTF-8"?>
<activiti-cfg>
 
  <database type="oracle" schema-strategy="check-version">
    <jdbc url="jdbc:smileysurprised:racle:thin:@localhost:1521:xe"
          driver="racle.jdbc.driver.OracleDriver"
          username="activiti"
          password="activiti" />
  </database>
 
  <job-executor activate="on" />
 
  <mail server="localhost" port="5025" />
 
</activiti-cfg>

gerry_fisher
Champ in-the-making
Champ in-the-making
Frederik,

Thank you. I ran cfg.create after the demo.setup but forgot to manually deploy activiti-cfg.jar. Problem sorted.

frederikherema1
Star Contributor
Star Contributor
NP, glad to be of service Smiley Wink