cancel
Showing results for 
Search instead for 
Did you mean: 

H2 standalone database difficulties

waao
Champ in-the-making
Champ in-the-making
Hi guys,

I'm a newbie about Activiti and BPMN things but i want to learn. I began 4 days ago, step by step I'd been able to work a little bit with Activiti in java code. Then i manage to integrate Activiti to Spring in a web app.

Now I want to set up my web app and the Activiti Explorer on the same DB and that's the problem.
I read the Activiti Explorer default config is an in memory H2 database, i got it, ok. So I've to set up a H2 standalone database !

How am i supposed to do ? And how do I config the Activiti Explorer to work with my H2 DB ?

I've to say that i've been trying since the morning, i followed H2 quickstart recommendation but it seems not work, i read the chapter in Activiti in Action but nothing is really explain about this point.

Could anyone help me to fix that ?
Thanks !

Waao.

PS : Sorry for my average english, frenchi' are not so good ! Smiley Very Happy.
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Running H2 standalone is normally just executing 'java -jar h2.jar'

However, if you go through that trouble, it might be better to install something like MySQL and have a 'real database' from the start

ambharath
Champ in-the-making
Champ in-the-making
Hi Waao,

Considering the date of your post, by now, I'm more than sure you must have solved the problem yourself but just to check if you followed my approach, here's how I went about it:

1) I downloaded the activiti-explorer war file (version 5.13)
2) Modified the content of the war file's WEB-INF\activiti-standalone-context.xml & WEB-INF\classes\db.properties so as to point to my H2 database URL
3) Deployed the file to Tomcat and on start-up of the server, the explorer fired up all proper and was pointing to my standalone H2 database.

Inside the activiti-standalone-context.xml, this was the XML snippet that I updated:
<code>
  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="org.h2.Driver"/>
    <property name="url" value="MY_H2_URL" />
    <property name="username" value="MY_H2_USER_NAME" />
    <property name="password" value="MY_H2_PASSWORD" />
    <property name="defaultAutoCommit" value="false" />
  </bean>
</code>
The content inside db.properties was pretty straightforward to tinker with.

-
A M Bharath

waao
Champ in-the-making
Champ in-the-making
Hi !

Thanks for your answers. I couldn't work on my problem until today, so i post this answer to thank you for your advices.

As jbarrez said, i've tried to directly connect the Activiti Explorer to a MySQL DB and it's succesfull !
I simply modified the db.properties file with my DB paramters, add mysql jdbc jar file in tomcat's lib' and done ! It's work !

ambharath
Champ in-the-making
Champ in-the-making
Hello Waao,

That's great! Keep going and keep posting!

-
A M Bharath