Version 21

    This wiki is addressing two possible installation scenarios:

     

    1. Deploy the jBPM web application (jbpm-console.war) --> see paragraph 1.

    2. Deploy the jBPM enterprise archive (jbpm-enterprise.ear) --> see paragraph 2.

     

    In addition, there are general things to be considered --> see paragraph 3.

     

    -


     

     

     

     

    1. Deploy the jBPM 3.2.2 web application (jbpm-console.war) on JBoss 4.2 / 4.3

     

    The default web application that ships with jBPM 3.2, jbpm-console.war, incorporates JSF. As it comes bundled with the necessary jars, deployment will throw exceptions under JBoss 4.2.x caused by conflicting libraries since these are already provided by Tomcat 6.

     

    In general, there are two possible ways to create a jbpm-enterprise.war compatible with JBoss 4.2/4.3:

     

     

     

    1.1 Using provided ant task included in the sources

     

    The easiest way at the moment would be to checkout the latest version from CVS (see JbpmBuildingTheSources for instructions how to do this), because the build.xml inside the jbpm.3/console branch has a custom target for building a 4.2-compatible web-app:

     

    ant war-4.2.x

     

     

     

    1.2 Manual build

     

    If you don't want to build from source, you can just take the jbpm-console.war from the distribution, but you have to make sure jbpm-console.war/WEB-INF/lib/ contains ONLY the following jars:

     

    Please note that gravel.jar and jbpm4jsf.jar are not included in the distribution and have to be downloaded separately from the jboss repository.

     

    Of course you also need proper datasource and security settings, see '3. General notes' at the end of this wiki.

     

     

     

     

     

     

     

    2. Deploy the jBPM 3.2.2 enterprise archive (jbpm-console.ear) on JBoss 4.2 / 4.3

     

    The default web application that ships with jBPM 3.2, jbpm-console.war, incorporates JSF. As it comes bundled with the necessary jars, deployment will throw exceptions under JBoss 4.2.x caused by conflicting libraries since these are already provided by Tomcat 6.

     

     

     

    2.1 Using provided ant task included in the sources

     

    Again, as mentioned in section 1.1 above, the easiest way to build the archive would be by using the provided ant tasks in the source. In order to create an enterprise archive that can be deployed on JBoss 4.2 / 4.3, a little manual intervention is still needed and outlined below.

     

    Once you have checked out the sources to a directory on your local drive (let's refer to this as $jbpm.3_2_2 from now on), you will have to perform the following steps to create the jbpm-console.ear.

     

    1. edit the 'hibernate.dialect' property in $jbpm.3_2_2/jpdl/jar/src/main/config/hibernate.cfg.xml to fit your environment

     

    2. open up $jbpm.3_2_2/console/build.xml in an editor and adapt the 'install' target:

     

    
    <target name="install" depends="package" description="Copy the jbpm-console.war to the local repository">
    <copy file="target/jbossas-4.0.x-jdk1.4/jbpm-console.war" tofile="${lib.jbpm.console.local}"></copy>
    </target>
    
    

    to use a war file pre-configured for JBoss AS 4.2.x by changing the above 'copy' source to:

     

    
    <copy file="target/jbossas-4.2.x/jbpm-console.war" tofile="${lib.jbpm.console.local}"></copy>
    
    

     

    3. now you can invoke the 'package' target of the $jbpm.3_2_2/enterprise/build.xml ant script:

     

    
    [$jbpm.3_2_2]$ ant -f ./enterprise/build.xml package
    
    

     

    4. this creates a file '$jbpm.3_2_2/enterprise/target/jbpm-console.ear' ready for deployment on JBoss 4.2.x.

     

    Of course you also need proper datasource and security settings, see '3. General notes' at the end of this wiki.

     

     

     

    2.2 Manual build

     

    If you don't want to build from source, you can just take the jbpm-enterprise.ear from the distribution, but you have to make sure jbpm-enterprise.ear/jbpm-console.war/WEB-INF/lib/ contains ONLY the following jars:

     

    Please note that gravel.jar and jbpm4jsf.jar are not included in the distribution and have to be downloaded separately from the jboss repository.

     

     

     

    2.3 Necessary AS wide configuration changes before deploying jbpm-enterprise.ear

     

    Regardless of how you have created jbpm-enterprise.ear, before you start the server, two AS wide config changes have to be done:

     

    2.3.1 Classloader configuration

     

    • in jboss4.2.x/server/$config/deploy/jboss-web.deployer/META-INF/jboss-service.xml set the attribute 'UseJBossWebLoader' to true

     

    2.3.2 Transaction management

     

    The current JTA enterprise implementation of the jBPM is not compliant with the updated JTA Transaction Manager Service in JBoss 4.2.x. To be able to run the enterprise configuration the following configuration needs to be updated in JBoss:

     

     

    Edit the

    conf/jboss-service.xml

    and update the xml configuration as follows:

    • Comment out the JBoss Transactions JTA section (lines 361-365)

       <!--
       <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
          name="jboss:service=TransactionManager">
          <attribute name="TransactionTimeout">300</attribute>
          <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute> 
       </mbean>
       -->
    

     

    • Uncomment the previous Transaction Manager Service configuration (lines 342-357)

       <mbean code="org.jboss.tm.TransactionManagerService"
          name="jboss:service=TransactionManager"
          xmbean-dd="resource:xmdesc/TransactionManagerService-xmbean.xml">
          <attribute name="TransactionTimeout">300</attribute>
          <!-- set to false to disable transaction demarcation over IIOP -->
          <attribute name="GlobalIdsEnabled">true</attribute>
          <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
    
          <!-- Transaction Integrity Checking -->
          <!-- Force a rollback if another thread is associated with the transaction at commit -->
          <depends optional-attribute-name="TransactionIntegrityFactory"
                   proxy-type="org.jboss.tm.integrity.TransactionIntegrityFactory">
             <mbean code="org.jboss.tm.integrity.FailIncompleteTransaction"
                    name="jboss:service=TransactionManager,plugin=TransactionIntegrity"></mbean>
          </depends>
       </mbean>
    

     

    OR - as an alternative to the above setting -

     

     

    set a flag for the new Transaction Manager to allow multiple one-phase aware resources to be enlisted within the same transaction:

     

    • in jboss4.2.x/server/$config/conf/jbossjta-properties.xml add the 'allowMultipleLastResources' attribute to the 'jta' properties section:

    
       <properties depends="arjuna" name="jta">
          <!-- existing properties
             ...
          -->
          <property name="com.arjuna.ats.jta.allowMultipleLastResources" value="true"></property>
       </properties>
    

    If not set, the execution of timers will lead to an exception. For more information on this setting (and possible other ways to get around it), please see the wiki entry Multiple1PC

     

     

     

    After you have applied these changes, restart your application server.

     

     

     

     

     

    3. General Notes

     

    In addition to the above procedures, in order to provide the correct database and security settings, additional actions as outlined below have to be performed. These apply to both the deployment of the web archive as well as the enterprise archive:

     

     

     

    3.1 Security settings

    add this XML block to the conf/login-config.xml file under the 4.2 / 4.3 installation:

     

        <application-policy name = "jbpm">
            <authentication>
                <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule"
                    flag="required">
                    <module-option name="dsJndiName">java:/JbpmDS</module-option>
                    <module-option name="principalsQuery">
                        SELECT PASSWORD_ FROM JBPM_ID_USER WHERE NAME_=?
                    </module-option>
                    <module-option name="rolesQuery">
                        SELECT g.NAME_ ,'Roles'
                        FROM JBPM_ID_USER u,
                        JBPM_ID_MEMBERSHIP m,
                        JBPM_ID_GROUP g
                        WHERE g.TYPE_='security-role'
                        AND m.GROUP_ = g.ID_
                        AND m.USER_ = u.ID_
                        AND u.NAME_=?
                    </module-option>
                </login-module>
            </authentication>
        </application-policy>
    

     

     

     

    3.2 Database configuration

    If you are using hypersonic as in the suite:

    • copy over the jbpm-ds.xml file from the 3.2 JBPM installation to the 4.2 environment (found under the jbpm/deploy directory).

    • Copy the jbpm/data/hypersonic/jbpm from the 3.2 installation to the 4.2 default/data/hypersonic/ directory.

     

    If you want to use a different database:

    • create a <your-db>-ds.xml file pointing to your db with a datasource jndi name of 'JbpmDS'

    • make sure to have the right Hibernate dialect in hibernate.cfg.xml