Camel Stardust Component On JBoss Server

The purpose of this document is to show how to deploy Camel Stardust component on a JBoss server.

Setting up the Environment

Before starting, you have to perform some prerequisites to setup the Stardust Portal and the process engine in JBoss. These are described in chapter JBoss of the Deployment Guide.

After you have configured your environment accordingly, change the jndi-name entry in the ipp-jcr-ds.xml file located in folder %JBOSS_HOME%/server/<server-name>/deploy as follows:

<jndi-name>jcr/jackrabbit<jndi-name>

Stardust Portal Deployment

Once the environment is installed, we can use the Maven archetype template provided by Stardust. To prepare a WAR deployment for JBoss 7.1, use the corresponding archetype:

Please refer to chapter Creating a Runtime Environment with Apache Maven in the Installation Guide section Other Archetypes of our Stardust Wiki Maven/Basic Setup page for details on how to retrieve this archetype.

Maven Command Example

The following Maven command example demonstrates how to create a new Maven project with the provided JBoss archetype:

mvn archetype:generate -DarchetypeGroupId=com.infinity.bpm.archetypes 
   -DarchetypeArtifactId=ipp-archetype-jb71-ipp-portal-war 
   -DarchetypeVersion=8.1.0 -DgroupId=com.infinity.test 
   -DartifactId=ipp-portal -Dversion=1.0-SNAPSHOT

Adjusting the Jackrabbit Context File

Perform the following modification to the file WEB-INF/config/ipp/spring/jackrabbit-jcr-context.xml:

  1. Change the value of class to org.eclipse.stardust.vfs.jcr.spring.JcrSpringSessionFactory
  2. Change the value of the jndiName to java:jcr/jackrabbit

Adjusting the Web Deployment Descriptor

In your web.xml file change the following:

<context-param>
   <param-name>carnot.login.MODEL_REQUIRED</param-name>
   <param-value>false</param-value>>
</context-param>

Logging into the Portal

Perform the following steps to log into the Process Portal:

  1. Use Maven to build the ipp-portal.war and deploy it in %JBOSS_HOME%/server/<server-name>/deploy
  2. Run the JBoss server and access to @art@ Stardust using a URL such as: http://localhost:8080/ipp-portal/

Portal
Figure: Logged into the Portal

Example

In this section we will deploy a simple model using a Camel Trigger which intercept information from a file and put them in structured data.

The model:

Example Model
Figure: Example Model

Camel-JBoss Component Setup

Note that from Camel 2.8 onwards there is no longer the need for using the Camel-JBoss component as Camel is now capable of loading type converters without package scanning.

However if you are using a Camel version prior to 2.8, and before deploying the model there are some changes in the Portal war file that must be performed:

  1. add the camel-context.xml file in folder WEB-INF/config/ipp/spring
  2. add the JBoss resolver to the camel-context.xml file. Please see the Camel online documentation http://camel.apache.org/camel-jboss.html for more details.
    <bean id="jbossResolver" class="org.apache.camel.jboss.JBossPackageScanClassResolver"/>
  3. add the camel-jboss-2.3.0.jar file in your WEB-INF/lib.

Run the server and deploy the model from the Administrator perspective in the Portal. Please refer to chapter Deploying Workflow Models in the End User Handbook for details.

Once you provide a file for the Camel file trigger, the Camel Trigger loads it and sends the data to Stardust.