cancel
Showing results for 
Search instead for 
Did you mean: 

Activit Version 5.2 with MySQL Exception at tomcat.start

rberla
Champ in-the-making
Champ in-the-making
Hello

I am setting up Activiti 5.2 locally. I switched the db from h2 to MySQL following the instructions in the manual. At starting up of tomcat I get a PersistenceException.

SCHWERWIEGEND: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error opening session.  Cause: org.h2.jdbc.JdbcSQLException: Verbindung ist unterbrochen: "session closed"
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: Verbindung ist unterbrochen: "session closed"
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:32)

h2 is stopped. Still tomcat seems to look for the wrong db-driver. I placed it (mysql-connector-java-5.1.15-bin.jar) into ../dependencies/libs. Any idea, what I am doing wrong?

Thanks for help
Regards
Riccardo
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
Hi,

Try running this, to get the new configuration-jar build and copied to the REST-webapp  (containing the new MySQL config):

ant demo.clean cfg.create demo.start

rberla
Champ in-the-making
Champ in-the-making
Hi,

Try running this, to get the new configuration-jar build and copied to the REST-webapp  (containing the new MySQL config):

ant demo.clean cfg.create demo.start

Hi, ant demo.start fails because mysql-db already exists and is not empty. The error looks like this:

internal.db.install.h2:

internal.db.install.h2.unnecessary:
     [echo] H2 is already installed

internal.db.install.unsupported:
     [echo] Automatic installation of mysql DB not supported.  It is assumed to be installed and running

h2.install:

internal.classpath.libs:

internal.taskdef.launch:

h2.start:

db.create:
     [echo] creating db

internal.classpath.libs:

internal.classpath.libs:

internal.db.create.engine:
      [sql] Executing resource: org/activiti/db/create/activiti.mysql.create.sql
      [sql] Failed to execute:  create table ACT_GE_PROPERTY ( NAME_ varchar(64), VALUE_ varchar(300), REV_ integer, primary key (NAME_) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin

BUILD FAILED
C:\projects\activiti-5.2\setup\build.xml:155: The following error occurred while executing this line:
C:\projects\activiti-5.2\setup\build.xml:195: The following error occurred while executing this line:
C:\projects\activiti-5.2\setup\build.xml:205: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'act_ge_property' already exists
        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 the first attempt to create a mysql-db instance for activiti 'ant demo.start' failed. I had to …

mysql> create database activiti;
Query OK, 1 row affected (0.02 sec)

mysql> grant all on activiti.* to 'activiti'@'localhost' identified by 'activiti' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on activiti.* to 'activiti'@'localhost.localdomain' identified by 'activiti' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql>
… myself using MySQL Command Line Client. After this, for one first time 'ant demo.start' worked and filled my mysql-db instance with your demo data.