How to install Bonita User Experience on a Tomcat server?

Prerequisites:

1. Download the Apache tomcat from the bonitasoft site and unzip it.

http://www.bonitasoft.com/products/BPM_downloads

(Note: You need to download Tomcat 6.0.33 from the “Bundles” tab, by doing this you save basic setup configuration required to run bonita engine on tomcat)
2. MYSQL should be installed on your computer. (See How to install LAMP in which you get Apache, MYSQL and phpmyadmin
3. Also you should have JDK (preferably greater than JDK- 1.5) on your
machine. If you don’t have one you can download and install it from –

http://www.oracle.com/technetwork/java/javase/downloads/index.html

(or you can see installation of java in topic: How to install BonitaSoft)

Once you are done with prerequisites follow the below mentioned steps:-

Step 1.  Create two databases named bonita_history and bonita_journal.

Commands:

$mysql -u root -p

Give your root password for mysql

$create database bonita_history;

$create database bonita_journal;

Step 2. Create user “bonita” with password as “bpm” and grant all permissions
for above created two databases.

Commands:

CREATE USER 'bonita'@'localhost' IDENTIFIED BY 'bpm';
GRANT ALL ON bonita_history.* TO 'bonita'@'localhost';
GRANT ALL ON bonita_journal.* TO 'bonita'@'localhost';

Step3. Essentially the downloaded Apache tomcat with BOS configuration uses H2
database and it internally uses hibernate framework for database interaction,
and these two file store the database properties required by the BOS . So, we
need to modify these two files.

Modify BOS configuration files names bonita-journal.properties and
bonita-history.properties, as mentioned below:

Note:These two files are located at –BOS-5.6.3-Tomcat-6.0.33/bonita/server/default/conf

1.  Comment the “hibernate.dialect” of H2 database. (Note: To comment out in
properties file we use “#”)

2. Comment “bonita.hibernate.interceptor” attribute as well.
3. Un comment “hibernate.dialect” and “bonita.hibernate.interceptor” from
“Examples- MYSQL” , make sure that the values of these 2 attributes are
“org.hibernate.dialect.MySQL5InnoDBDialect” and
“org.ow2.bonita.env.interceptor.MySQLDescNullFirstInterceptor”
respectively for  Mysql database.

Here is commented portion in bonita.history.properties:

# H2 Hibernate dialect 
#hibernate.dialect                        org.hibernate.dialect.H2Dialect 
 
# Using an interceptor can change the database behaviour. By default, an interceptor is defined to order the result of queries by adding null values at the end. 
#bonita.hibernate.interceptor        org.ow2.bonita.env.interceptor.H2DescNullFirstInterceptor

The line next to it (in bonita.history.properties and bonita.journal.properties files) will automatically create tables in databases formed above. Don’t forget to comment this line after the first run of BOS-Tomcat. Line is:

# Table are automatically create in database 
##### COMMENTED AFTER FIRST RUN ####### 
#hibernate.hbm2ddl.auto                   update

Uncommented portion in bonita.history.properties file and bonita.journal.properties file:

## 
# MYSQL 
 
hibernate.dialect                        org.hibernate.dialect.MySQL5InnoDBDialect 
bonita.hibernate.interceptor             org.ow2.bonita.env.interceptor.MySQLDescNullFirstInterceptor

4. Also we need to configure the hibernate properties in context.xml file
which is located at “BOS-5.6.3-Tomcat-6.0.33/conf”, the properties which
needs to be configured is as shown below (This needs to be done twice for
both databases under name – “bonita/default/journal” and “bonita/default/
history” in content.xml file) :

Locate the data source configuration file called context.xml: <TOMCAT_HOME>/conf/context.xml

Locate the Resource tags for bonita/default/journal and for bonita/default/history and comment out the original H2 lines:

  <!– <Resource name=”bonita/default/journal”
auth=”Container”
type=”javax.sql.DataSource”
maxActive=”100″
minIdle=”10″
maxWait=”10000″
initialSize=”1″
maxPoolSize=”15″
minPoolSize=”3″
maxConnectionAge=”0″
maxIdleTime=”1800″
maxIdleTimeExcessConnections=”120″
idleConnectionTestPeriod=”30″
acquireIncrement=”3″
testConnectionOnCheckout=”true”
removeAbandoned=”true”
logAbandoned=”true”
username=”bonita”
password=”bpm”

driverClassName=”org.h2.Driver”
url=”jdbc:h2:file:${BONITA_HOME}/server/default/work/databases/bonita_journal.db;FILE_LOCK=NO;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE”/>

<Resource name=”bonita/default/history”
auth=”Container”
type=”javax.sql.DataSource”
maxActive=”100″
minIdle=”10″
maxWait=”10000″
initialSize=”1″
maxPoolSize=”15″
minPoolSize=”3″
maxConnectionAge=”0″
maxIdleTime=”1800″
maxIdleTimeExcessConnections=”120″
idleConnectionTestPeriod=”30″
acquireIncrement=”3″
testConnectionOnCheckout=”true”
removeAbandoned=”true”
logAbandoned=”true”
username=”bonita”
password=”bpm”
driverClassName=”org.h2.Driver”
url=”jdbc:h2:file:${BONITA_HOME}/server/default/work/databases/bonita_history.db;FILE_LOCK=NO;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE”/>–>

Uncomment this block:

 <!-- Sample to use with MySQl -->  
    <Resource name="bonita/default/journal"   
              auth="Container"   
              type="javax.sql.DataSource"  
              maxActive="100"   
              minIdle="10"   
              maxWait="10000"   
              initialSize="1"  
              maxPoolSize="15"  
              minPoolSize="3" 
              maxConnectionAge="0" 
              maxIdleTime="1800" 
              maxIdleTimeExcessConnections="120" 
              idleConnectionTestPeriod="30" 
              acquireIncrement="3" 
              testConnectionOnCheckout="true" 
              removeAbandoned="true"  
              logAbandoned="true"  
              username="bonita"  
              password="bpm" 
               
              driverClassName="com.mysql.jdbc.Driver"  
              url="jdbc:mysql://localhost:3306/bonita_journal?dontTrackOpenResources=true"/> 
    
       
      <Resource name="bonita/default/history"   
              auth="Container"   
              type="javax.sql.DataSource"  
              maxActive="100"   
              minIdle="10"   
              maxWait="10000"   
              initialSize="1"  
              maxPoolSize="15"  
              minPoolSize="3" 
              maxConnectionAge="0" 
              maxIdleTime="1800" 
              maxIdleTimeExcessConnections="120" 
              idleConnectionTestPeriod="30" 
              acquireIncrement="3" 
              testConnectionOnCheckout="true" 
              removeAbandoned="true"  
              logAbandoned="true"  
              username="bonita"  
              password="bpm" 
              driverClassName="com.mysql.jdbc.Driver"  
              url="jdbc:mysql://localhost:3306/bonita_history?dontTrackOpenResources=true"/>

Note: Read the instructions carefully and comment /uncomment lines as instructed. Any mistake may lead to several internal errors.

  1. Once the above configuration is done, add mysql-jdbc driver (mysql-connector-java-5.1.6.jar file) (http://dev.mysql.com/downloads/connector/j/ ) into “BOS-5.6.3-Tomcat-6.0.33/lib/bonita” (or BOS-5.6.3-Tomcat-6.0.33/lib) location and remove h2-1.2.139.jar from this location as it is no more required.
  2. Start the tomcat server:
    $ cd BOS-5.6.3-Tomcat-6.0.33/bin  $./startup.sh
  3. Once the tomcat server starts hit this url http://localhost:8080/bonita/ , use default credentials user – “admin” and password- “bpm” to login. If you are able to login with no errors then the configuration is fine.

If it says not found, go to http://localhost:8080. Check whether it displays Apache Tomcat welcome page? If no, it means your 8080 port is busy in another application. So you need to change the port number in BOS-5.6.3-Tomcat-6.0.33/conf/server.xml file . Change the port to 8081 or another free port (total ports availabe are 56000)

8. Bonita creates almost 69 tables into the above 2 created database, to verify execute command “select * from bonita_journal;” from the mysql client.

9.  After the first run you need to comment “hibernate.hbm2ddl.auto” property from bonita-journal.properties and bonita-history.properties files as it is needed to create the table only at first run.

 

Advertisements

About Priyanka Kapoor

Simple, Hardworking & friendly.....
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to How to install Bonita User Experience on a Tomcat server?

  1. Bernard LE TRAON says:

    Good !
    For server running ubuntu 64bits make a: sudo apt-get install ia32-libs and all running fine!

  2. Harikumar says:

    Hi Priyanka,
    I am new to this framework.I followed above mentioned procedure and successfully configured the bonitasotf with tomcat bundle. I would wish to know the table structure and use of each tables. Kindly do the need full.

    Regards,
    Harikumar A.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s