cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while initializing Database connection org.h2.jdbc.JdbcSQLException: IO Exception

sunitanayak83
Champ in-the-making
Champ in-the-making
Hi All,

I am getting the below error while trying to run my activiti process from a java application. For the java.lang.NoClassDefFoundError: org/apache/ibatis/type/TypeReference, I have already added the ibatis.jar file on my classpath, but still getting the class not found error message. I am using Alfresco Activiti BPM Suite v1.4.0

ERROR org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl - Exception while initializing Database connection
org.h2.jdbc.JdbcSQLException: IO Exception: "C:/Users/User/activiti outside C:/Program Files (x86)/activiti12/act_data/h2" [90028-176]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
    at org.h2.message.DbException.get(DbException.java:178)
    at org.h2.message.DbException.get(DbException.java:154)
    at org.h2.engine.ConnectionInfo.setBaseDir(ConnectionInfo.java:183)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
    at java.lang.Thread.run(Unknown Source)

    at org.h2.engine.SessionRemote.done(SessionRemote.java:624)
    at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:133)
    at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:448)
    at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:329)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
    at org.h2.Driver.connect(Driver.java:72)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at org.apache.ibatis.datasource.unpooled.UnpooledDataSource.getConnection(UnpooledDataSource.java:64)
    at org.apache.ibatis.datasource.pooled.PooledDataSource.popConnection(PooledDataSource.java:349)
    at org.apache.ibatis.datasource.pooled.PooledDataSource.getConnection(PooledDataSource.java:55)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatabaseType(ProcessEngineConfigurationImpl.java:685)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataSource(ProcessEngineConfigurationImpl.java:636)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:452)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:440)
    at TestingActivitiThruJava.main(TestingActivitiThruJava.java:16)
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/ibatis/type/TypeReference
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:191)
    at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:91)
    at org.apache.ibatis.io.Resources.classForName(Resources.java:229)
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.typeAliasesElement(XMLConfigBuilder.java:81)
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:61)
    at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:55)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.parseMybatisConfiguration(ProcessEngineConfigurationImpl.java:776)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initMybatisConfiguration(ProcessEngineConfigurationImpl.java:759)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:740)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:470)
    at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:440)
    at TestingActivitiThruJava.main(TestingActivitiThruJava.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.ibatis.type.TypeReference
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    … 26 more
2 REPLIES 2

hari
Star Contributor
Star Contributor
Hi Sunita,

Since there are many internal references to other classes from one jar to the other, make sure you use maven to include all the relevant jars or you explicitly include all the jars found under lib folder of activiti to your class path. 

trademak
Star Contributor
Star Contributor
Hi Sunita,

It looks like an issue with the installation path. Could you try installing Activiti in an directory without a space?

Best regards,