<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    jBPM3 on Tomcat
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/admin">Administrator Administrator</a> in <i>jBPM</i> - <a href="http://community.jboss.org/docs/DOC-16106">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>This article is a guide to deploying jBPM 3.2 to Tomcat 5.5 and 6.0.</p><p><div class="toc" style="border: 1px dashed black; padding: 10px;"><ul><ul><li>
<a class="jive-link-anchor-small" href="#Tomcat_60">Tomcat 6.0</a>
</li>
<ul><li>
<a class="jive-link-anchor-small" href="#Downloads">Downloads</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Dependencies">Dependencies</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Configuration">Configuration</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Launch">Launch</a>
</li>
</ul><li>
<a class="jive-link-anchor-small" href="#Tomcat_55">Tomcat 5.5</a>
</li>
<ul><li>
<a class="jive-link-anchor-small" href="#Downloads_660973">Downloads</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Dependencies_89611">Dependencies</a>
</li>
</ul><li>
<a class="jive-link-anchor-small" href="#Other_Databases">Other Databases</a>
</li>
<ul><li>
<a class="jive-link-anchor-small" href="#Dependencies_996144">Dependencies</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Configuration_739354">Configuration</a>
</li>
<li>
<a class="jive-link-anchor-small" href="#Launch_986957">Launch</a>
</li>
</ul></ul></ul></div></p><h2 id="Tomcat_60">Tomcat 6.0</h2><p>The basic procedure gets the jBPM console to work against an HSQL in-process database. It is advisable to attempt this procedure against a&#160; clean Tomcat 6.0 installation before going for Tomcat 5.5 or other databases.</p><h3 id="Downloads">Downloads</h3><p>0. Download the <a class="jive-link-external-small" href="http://sourceforge.net/projects/jbpm/files/jBPM%203/jbpm-jpdl-3.2.7/jbpm-installer-3.2.7.jar/download">jBPM installer</a> installer. Launch the installer with the following command. Select the <em>jBPM3 Standalone</em> component only.</p><pre class="jive-pre"><code class="jive-code">$ java -jar jbpm-installer-3.2.x.jar
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1. Download the latest snapshot of <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/repositories/snapshots/org/jbpm/jbpm3/jsf-console-tomcat/">jsf-console-tomcat.war</a>, the web console based on JSF. Extract the contents to the <span style="font-family: courier new,courier;">tomcat-&lt;version&gt;/webapps/jbpm-console</span>/ directory.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2. Download the latest snapshot of <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/repositories/snapshots/org/jbpm/jbpm3/jbpm-tomcat/">jbpm-tomcat.jar</a>, the Tomcat integration bits, to <span style="font-family: courier new,courier;">tomcat-6.0.x/lib/</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>3. Download <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/groups/public/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar">jta.jar</a> to <span style="font-family: courier new,courier;">jbpm-console/WEB-INF/lib/</span></p><h3 id="Dependencies">Dependencies</h3><p>4. Copy all files from <span style="font-family: courier new,courier;">jbpm-3.2.x/lib/</span> <em>except</em> <span style="font-family: courier new,courier;">hsqldb.jar</span>, <span style="font-family: courier new,courier;"> </span><span style="font-family: courier new,courier;">jbpm-console.war</span>, <span style="font-family: courier new,courier;">junit.jar</span> and <span style="font-family: courier new,courier;">log4j.jar</span> to <span style="font-family: courier new,courier;">jbpm-console/WEB-INF/lib/</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>5. Copy <span style="font-family: courier new,courier;">hsqldb.jar</span> from <span style="font-family: courier new,courier;">jbpm-3.2.x/lib/</span> to <span style="font-family: courier new,courier;">tomcat-6.0.x/lib/</span></p><h3 id="Configuration">Configuration</h3><p>6. Copy <span style="font-family: courier new,courier;">jbpm.cfg.xml</span> and <span style="font-family: courier new,courier;">hibernate.cfg.xml</span> from <span style="font-family: courier new,courier;">jbpm-3.2.x/config/</span> to <span style="font-family: courier new,courier;">jbpm-console/WEB-INF/classes</span>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>7. Examine the data source preconfigured in <span style="font-family: courier new,courier;">jbpm-console/META-INF/context.xml</span>. Open <span style="font-family: courier new,courier;">hibernate.cfg.xml</span> and switch from JDBC connections to the data source as follows.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>a) Uncomment the DataSource properties section.</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment">&lt;!-- DataSource properties (begin) --&gt;
<span class="jive-xml-tag">&lt;property name="hibernate.connection.datasource"&gt;</span>java:comp/env/jdbc/JbpmDataSource<span class="jive-xml-tag">&lt;/property&gt;</span>
&lt;!-- DataSource properties (end) --&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>b) Comment out the JDBC connection properties section.</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment">&lt;!-- JDBC connection properties (begin) ===
<span class="jive-xml-tag">&lt;property name="hibernate.connection.driver_class"&gt;</span>org.hsqldb.jdbcDriver<span class="jive-xml-tag">&lt;/property&gt;</span>
<span class="jive-xml-tag">&lt;property name="hibernate.connection.url"&gt;</span>jdbc:hsqldb:mem:jbpm<span class="jive-xml-tag">&lt;/property&gt;</span>
<span class="jive-xml-tag">&lt;property name="hibernate.connection.username"&gt;</span>sa<span class="jive-xml-tag">&lt;/property&gt;</span>
<span class="jive-xml-tag">&lt;property name="hibernate.connection.password"&gt;</span><span class="jive-xml-tag">&lt;/property&gt;</span>
==== JDBC connection properties (end) --&gt;</span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>c) Comment out the automatic schema creation property.</p><pre class="jive_text_macro jive_macro_code"><p>&lt;!-- Automatic schema creation (begin) ===<br/>&lt;property name="hibernate.hbm2ddl.auto"&gt;create&lt;/property&gt;<br/>==== Automatic schema creation (end) --&gt;</p></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>8. The configuration is correct and complete at this point.&#160; However, no user will be able to authenticate because the database is empty. To provide seed data, download the HSQLDB data files <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbpm/jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/database/hypersonic/jbpmDB.script">jbpmDB.script</a> and <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbpm/jbpm3/branches/jbpm-3.2-soa/distribution/src/main/resources/database/hypersonic/jbpmDB.properties">jbpmDB.properties</a> to <span style="font-family: courier new,courier;">tomcat-&lt;version&gt;/work/Catalina/localhost/jbpm-console/</span>. Create the directory if necessary.</p><h3 id="Launch">Launch</h3><p>All set! Go ahead and start Tomcat. Point your browser to the <a class="jive-link-external-small" href="http://localhost:8080/jbpm-console">jBPM web console</a>. The login page should appear.</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/10625/jbpm-console-login.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/10625/jbpm-console-login.png </span></a></p><p>After logging in as one of the example users, the sample processes will be displayed. To deploy a new process definition, log in as a user in the <em>admin</em> group and click the Deploy link in the Actions panel on the left side.</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/10627/jbpm-console-processes.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/10627/jbpm-console-processes.png </span></a></p><h2 id="Tomcat_55">Tomcat 5.5</h2><p>Since the procedure is very similar to Tomcat 6.0, only the differences will be noted.</p><h3 id="Downloads_660973">Downloads</h3><p>2. Download the latest snapshot of <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/repositories/snapshots/org/jbpm/jbpm3/jbpm-tomcat/">jbpm-tomcat.jar</a>, the Tomcat integration bits, to <span style="font-family: courier new,courier;">tomcat-5.5.x/server/lib</span>/</p><p>3. Download <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/groups/public/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar">jta.jar</a>, <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/groups/public/javax/el/el-api/1.0/el-api-1.0.jar">el-api.jar</a> and <a class="jive-link-external-small" href="https://repository.jboss.org/nexus/content/groups/public/com/sun/el/el-ri/1.0/el-ri-1.0.jar">el-ri.jar</a> to <span style="font-family: courier new,courier;">jbpm-console/WEB-INF/lib/</span></p><h3 id="Dependencies_89611">Dependencies</h3><p>4. Copy <span style="font-family: courier new,courier;">hsqldb.jar</span> from <span style="font-family: courier new,courier;">jbpm-3.2.x/lib/</span> to <span style="font-family: courier new,courier;">tomcat-5.5.x/common/lib</span>/</p><h2 id="Other_Databases">Other Databases</h2><p>Follow the base procedure for the selected Tomcat version, with the following changes depending on the target database.</p><h3 id="Dependencies_996144">Dependencies</h3><p>4. Copy the JDBC driver file to <span style="font-family: courier new,courier;">tomcat-6.0.x/lib</span> or <span style="font-family: courier new,courier;">tomcat-5.5.x/common/lib</span> depending on the target Tomcat version.</p><h3 id="Configuration_739354">Configuration</h3><p>6. Copy <span style="font-family: courier new,courier;">jbpm.cfg.xml</span> and <span style="font-family: courier new,courier;">hibernate.cfg.&lt;database&gt;.xml</span> from <span style="font-family: courier new,courier;">jbpm-3.2.x/config/</span> to <span style="font-family: courier new,courier;">jbpm-console/WEB-INF/classes/</span></p><p>7. Edit the data source preconfigured in <span style="font-family: courier new,courier;">jbpm-console/META-INF/context.xml</span>. Set the appropriate driverClassName, url, username and password attributes for the target database.</p><p>8. Create the database schema and load seed data as follows.</p><p>a) Execute the <span style="font-family: courier new,courier;">jbpm-3.2.x/database/jbpm.jpdl.&lt;database&gt;.sql</span> script to create the required tables, indexes and constraints.</p><p>b) Run the following SQL statements to fill in the example users.</p><pre class="jive-pre"><code class="jive-code jive-sql"><span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_USER <span class="jive-sql-keyword">VALUES</span>(1,'U','<span class="jive-sql-keyword">user</span>','<span class="jive-sql-keyword">user</span>@sample.<span class="jive-sql-keyword">domain</span>','<span class="jive-sql-keyword">user</span>');
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_USER <span class="jive-sql-keyword">VALUES</span>(2,'U','manager','manager@sample.<span class="jive-sql-keyword">domain</span>','manager');
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_USER <span class="jive-sql-keyword">VALUES</span>(3,'U','admin','admin@sample.<span class="jive-sql-keyword">domain</span>','admin');
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_USER <span class="jive-sql-keyword">VALUES</span>(4,'U','shipper','shipper@sample.<span class="jive-sql-keyword">domain</span>','shipper');
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_GROUP <span class="jive-sql-keyword">VALUES</span>(1,'G','sales','organisation',<span class="jive-sql-keyword">NULL</span>);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_GROUP <span class="jive-sql-keyword">VALUES</span>(2,'G','admin','security-<span class="jive-sql-keyword">role</span>',<span class="jive-sql-keyword">NULL</span>);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_GROUP <span class="jive-sql-keyword">VALUES</span>(3,'G','hr','organisation',<span class="jive-sql-keyword">NULL</span>);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_GROUP <span class="jive-sql-keyword">VALUES</span>(4,'G','<span class="jive-sql-keyword">user</span>','security-<span class="jive-sql-keyword">role</span>',<span class="jive-sql-keyword">NULL</span>);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_GROUP <span class="jive-sql-keyword">VALUES</span>(5,'G','manager','security-<span class="jive-sql-keyword">role</span>',<span class="jive-sql-keyword">NULL</span>);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(1,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,2,4);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(2,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,3,4);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(3,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,1,4);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(4,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,4,4);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(5,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,4,3);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(6,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,2,3);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(7,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,3,3);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(8,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,3,2);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(9,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,2,2);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(10,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,2,5);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(11,'M',<span class="jive-sql-keyword">NULL</span>,'boss',2,1);
<span class="jive-sql-keyword">INSERT</span> <span class="jive-sql-keyword">INTO</span> JBPM_ID_MEMBERSHIP <span class="jive-sql-keyword">VALUES</span>(12,'M',<span class="jive-sql-keyword">NULL</span>,<span class="jive-sql-keyword">NULL</span>,1,1);
</code></pre><h3 id="Launch_986957">Launch</h3><p>Logins as&#160; example users will work, although no sample processes will be immediately available. You will have to deploy processes through the web console as indicated above.</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-16106">going to Community</a></p>

        <p style="margin: 0;">Create a new document in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>