cancel
Showing results for 
Search instead for 
Did you mean: 

Simple question Can't change H2 parameters-exception

vitalygoji
Champ in-the-making
Champ in-the-making
I am just starting with activiti


These are default database connectivity parameters found in /webapps/activiti-explorer/WEB-INF/classes/db.properties:

db=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000
jdbc.username=sa
jdbc.password=

I want to change default memory database to the H2 instance :

db=h2
jdbc.driver=org.h2.Driver
jdbc.url=jdbc:h2:tcp://localhost/~/activiti
jdbc.username=sa
jdbc.password=


tomcat gives me an error:  Connection is broken: "unexpected status 16777216" [90067-176]



Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.activiti.engine.IdentityService org.activiti.explorer.conf.DemoDataConfiguration.identityService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'identityService' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.activiti.engine.IdentityService org.activiti.explorer.conf.ActivitiEngineConfiguration.identityService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [org/activiti/explorer/conf/ActivitiEngineConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.activiti.engine.ProcessEngine org.activiti.explorer.conf.ActivitiEngineConfiguration.processEngine()] threw exception; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineFactoryBean': FactoryBean threw exception on object creation; nested exception is org.activiti.engine.ActivitiException: couldn't check if tables are already present using metadata: Connection is broken: "unexpected status 16777216" [90067-176]
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Well, yes. You are pointing it to a standalone H2 server over tcp. You need to have that running.

andymcc
Champ in-the-making
Champ in-the-making
I've just encountered exactly the same issue running Activiti 5.18 on Tomcat 8.0.28, accessing H2 1.4.190.jar running as a standalone server over tcp. (I'd set things up in accordance with https://forums.activiti.org/comment/17393#comment-17393 so was confident that it should work).

An initial solution for me was to revert to an earlier H2 release, specifically 1.3.175. That at least let me connect to the database, however, when I stop and restart Tomcat the error recurs.

I've raised a JIRA about the first part (the need to revert) but am still tryin to understand more about the second.

I'm also a newcomer to Activiti so, my apologies if the points I raise seem trivial.

Cheers

Andy McC


vasile_dirla
Star Contributor
Star Contributor
this is caused by a incompatibility between the client and the server.
in activiti we use that dependency:
<code>
<dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.3.176</version>
      </dependency>
</code>

that means the connection with H2 version 1.3.176 is guaranteed.

if you would like to use H2 1.4.190 then you have to use the 1.4.190 library in the client side. (just tested with this version and is working)

andymcc
Champ in-the-making
Champ in-the-making
Thanks for replying Vasile.  I was working with a clean installation the latest Tomcat, h2 and Activiti *binaries*, so hadn't been aware of that dependency. I'll know to look at the source/pom in future before posting.
Thanks,
Andy McC