Wednesday, February 18, 2009

Standalone application set up

Nova Bonita 4.0.1 can be deployed as an embedded library part of Java Standard Edition applications. To do that you need to follow the steps listed below:

  1. Take the environment.xml and environment-xml-history.xml found in the bonita-runtime-4.0.1/conf folder and include them in your application's folder.
  2. Customize the Hibernate properties files (hibernate.properties, hibernate-core.properties and hibernate-history.properties) according to your database settings (more details can be found on this post) and include them in the same folder you included the XML files mentioned in the previous step.
  3. Add the folder that contains the configuration files provided in steps 2 and 3 to the classpath of your application.
  4. Add the database drivers necessary to support the selected database engine (configured in step 2) to your application's classpath.
  5. Add all the libraries (JAR files) found in the bonita-runtime-4.0.1/lib/server folder to your application's classpath.
  6. Include in your application a JAAS configuration file. The bonita-runtime-4.0.1 package includes a sample file called jaas-standard.cfg (located in the bonita-runtime-4.0.1/conf folder) that can be use to get things up and running quickly, but it is not suitable for production use.
  7. Set the system property java.security.auth.login.config with the path of the jaas-configuration.cfg file.
  8. Set the system property org.ow2.bonita.api-type with the value Standard to signal the use of Bonita as an embedded engine.
  9. Run the application!

Setting a security environment (steps 6 and 7) and performing a JAAS login in the application are necessary for the Bonita Engine to work properly. The default jaas-configuration.cfg file provided has a very simple implementation of security that lists the user names and passwords in the configuration file itself and must be replaced with a real login module for use with any production application.

7 comment(s):

  1. hi,

    great work!
    but can you specify how and where can i set the system properties 'java.security.auth.login.config' and 'org.ow2.bonita.api-type'?
    regars
    tony

    ReplyDelete
  2. Thanks, I am glad it helped!

    There are many ways to set up system properties in Java. The more simple way is to use the -D parameter in the command line, for example:

    java -Dorg.ow2.bonita.api-type=Standard -Djava.security.auth.login.config ....

    You can also define them in the JAVA_OPTS system variable. For example (in Windows):

    set JAVA_OPTS=-Dorg.ow2.bonita.api-type=Standard

    Or if you are using Ant, you can set them in the "sysproperty" subelement of the "java" task.

    ReplyDelete
  3. Hi Luis,

    thank you very much.

    Antonio

    ReplyDelete
  4. Hi Luis,

    Thanks a lot....similar tutorials are birght and very good. We wait for others....

    alis

    ReplyDelete
  5. Hi Alis!

    I am glad you found them useful.

    If there is a specific topic you would like to see discussed, please let me know. I cannot make any promises but I will consider it ;-)

    Regards,
    Luis!

    ReplyDelete
  6. Hi Alis,

    Appreciate if you could provide a tutorial on deploy Bonita to IBM Websphere 7.0.

    ReplyDelete
  7. How to Replace Hibernet-core.properties with any DATASOURCE value in Bonita ??

    Is there any way we can pass JNDI NAMe instead of this .properties file ?

    ReplyDelete