cancel
Showing results for 
Search instead for 
Did you mean: 

configure mysql for activiti 5-10

nommyravian
Champ in-the-making
Champ in-the-making
Hi, I'm posting this just to help new users of Activiti like me;

I faced non-persistent (h2 db is dropped and re created every time when I started demo) in activiti 5-10 (and this issue is not present in activiti 5-9) which I solved after wasting my full day. Solution is here http://forums.activiti.org/en/viewtopic.php?f=6&t=4688.

I also couldn't find a proper step by step guidance to change the default h2 to mysql except this link http://forums.activiti.org/en/viewtopic.php?f=6&t=3496&p=14118&hilit=mysql#p14118 but I still faced problems so I want to add a couple of more steps in the solution for the new users.

  • step 00: install mysql and create a database named activiti using the following command;
  • create database activiti;
  • step 01: make sure the file: {activiti-home}/setup/build.db.properties has the contents like below
  • db=mysql
    jdbc.driver=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/activiti
    jdbc.username={mysql username, mine is "root"}
    jdbc.password={mysql password, mine is "root"}
  • step 02: create sql file
  • just need to duplicate the file h2.data.sql in directory:
    {activiti-home}/setup/files/demo
    and change file name to mysql.data.sql

  • step 03(optional: I didn't try it): if you want to use the custom tomcat instead of the default tomcat
  • open the file {activiti-home}/setup/build.properties
    look for download.dir entry and change the value to the directory which contains file apache-tomcat-{your-version}.zip

  • step 04: copy mysql-connector-java-5.1.22-bin.jar (latest for me) to the listed directory below:
  • {activiti-home}/setup/files/dependencies/libs
  • step 05: add the following line to the path {activiti-home}/workspace/activiti-engine-examples/.classpath
  • <classpathentry kind="lib" path="libs-runtime/mysql-connector-java-5.1.22-bin.jar"/>
  • step 06: modify the listed text files below to add "mysql-connector-java-5.1.22-bin.jar":
  • - {activiti-home}/setup/files/dependencie/libs.engine.test.txt
    - {activiti-home}/setup/files/dependencie/libs.webapp.explorer.txt
    - {activiti-home}/setup/files/dependencie/libs.webapp.rest.txt
  • step 07: modify the following file
    {activiti-home}/setup/build.xml
  • + looking for the target demo.start and delete(delete or disable are also suitable) the depends: h2.start
    + looking for the target demo.install and comment out the following tags:
    <antcall target="h2.install" />
    <antcall target="h2.start" />
    <antcall target="h2.stop" />

  • step 08: To change the database that Explorer uses in the demo setup, change the properties file
    {activiti-home}apps/apache-timcat-6.x/webapps/activiti-explorer/WEB-INF/classes/db.properties
    new contents should be
  • db=mysql
    jdbc.driver=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/activiti
    jdbc.username={mysql username, mine is "root"}
    jdbc.password={mysql password, mine is "root"}
    Also, place "mysql-connector-java-5.1.22-bin.jar" in the path,
     {activiti-home}apps\apache-tomcat-6.0.32\lib/ 
  • step 09: run ant demo.install and then ant demo.start
  • All tables should have been created in mysql along with the demo data. Check activiti database in mysql to confirm.

    I hope that you don't waste your full day to fix these things. Enjoy!

    Salman
    12 REPLIES 12

    jbarrez
    Star Contributor
    Star Contributor
    Hmmm… not really a clue, actually.

    Did you already try the beta war on http://activiti.org/download.html ?

    smoltok
    Champ in-the-making
    Champ in-the-making
    Just to tell you that you spare me some waste of time !!

    Thanks for this post !

    jbarrez
    Star Contributor
    Star Contributor
    Yes, that is the correct file indeed.