<!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="https://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;">
    [jBPM 5.3 - SQL] - Setting up jBPM5.3 with MS SQL Server 2008 (jtds)
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/thomas.setiabudi">Thomas Setiabudi</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/751586#751586">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I try to setup jBPM5.3 with MS SQL Server 2008 but still cant get it works. I have done the following steps</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1. Download "jbpm-5.3.0.Final-installer-full.zip"</p><p>2. Download "eclipse-java-helios-SR2-win32-x86_64.zip" as my dev PC does not have Internet connection</p><p>3. unzip the "jbpm-5.3.0.Final-installer-full.zip" and I get the "jbpm-installer" folder</p><p>4. copy the "eclipse-java-helios-SR2-win32-x86_64.zip" to "jbpm-installer\lib"</p><p>5. modify the build.xml in "jbpm-installer" :</p><p>&#160;&#160;&#160; I made change from:</p><p>&#160;&#160;&#160;&#160; </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment">&lt;!-- Download Eclipse --&gt;</span>
&#160; <span class="jive-xml-tag">&lt;condition property="download.type" value="win32"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;os family="windows" /&gt;</span>
&#160; <span class="jive-xml-tag">&lt;/condition&gt;</span> 
</code></pre><p> to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment">&lt;!-- Download Eclipse --&gt;</span>
&#160; <span class="jive-xml-tag">&lt;condition property="download.type" value="win32-x86_64"&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;os family="windows" /&gt;</span>
&#160; <span class="jive-xml-tag">&lt;/condition&gt;</span>
</code></pre><p> in order to make the ant install.demo detect my eclipse installer</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>6. Then I start to refer the instruction to change the DB in <a class="jive-link-external-small" href="http://docs.jboss.org/jbpm/v5.3/userguide/ch.installer.html#d0e597">http://docs.jboss.org/jbpm/v5.3/userguide/ch.installer.html#d0e597</a> </p><p>7. changed hibernate dialect in "db/persistence.xml" to SQLServerDialect (attached file db_persistence.xml)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/&gt;</span>
</code></pre><p>8. changed another persistence.xml in "<code class="filename">task-service/resources/META-INF/persistence.xml</code>" (attached task-service_resources_meta-inf_persistence.xml)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyTaskDB" /&gt;</span>

</code></pre><p>9. As the jBPM 5.3 full installer comes with JBoss AS 7, so I modified the "standalone.xml" (attached standalone.xml)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;datasources&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;connection-url&gt;</span>jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB<span class="jive-xml-tag">&lt;/connection-url&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;driver&gt;</span>JTDS<span class="jive-xml-tag">&lt;/driver&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;pool&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;min-pool-size&gt;</span>1<span class="jive-xml-tag">&lt;/min-pool-size&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;max-pool-size&gt;</span>4<span class="jive-xml-tag">&lt;/max-pool-size&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;prefill&gt;</span>false<span class="jive-xml-tag">&lt;/prefill&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;use-strict-min&gt;</span>false<span class="jive-xml-tag">&lt;/use-strict-min&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;flush-strategy&gt;</span>FailingConnectionOnly<span class="jive-xml-tag">&lt;/flush-strategy&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/pool&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;security&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;user-name&gt;</span>test<span class="jive-xml-tag">&lt;/user-name&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;password&gt;</span>12345<span class="jive-xml-tag">&lt;/password&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/security&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;validation&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;check-valid-connection-sql&gt;</span>SELECT 1<span class="jive-xml-tag">&lt;/check-valid-connection-sql&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;validate-on-match&gt;</span>false<span class="jive-xml-tag">&lt;/validate-on-match&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;background-validation&gt;</span>false<span class="jive-xml-tag">&lt;/background-validation&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/validation&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/datasource&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;drivers&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;driver name="JTDS" module="net.sourceforge.jtds"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;driver-class&gt;</span>net.sourceforge.jtds.jdbc.Driver<span class="jive-xml-tag">&lt;/driver-class&gt;</span>&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/driver&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/drivers&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/datasources&gt;</span>

</code></pre><p>10. Because I use SQL Server, I continue to section "<a class="jive-link-anchor-small">3.7.4. Using a different database</a>" in <a class="jive-link-external-small" href="http://docs.jboss.org/jbpm/v5.3/userguide/ch.installer.html#d0e597">http://docs.jboss.org/jbpm/v5.3/userguide/ch.installer.html#d0e597</a></p><p>I choose to install the DB Driver in JBoss AS 7 as module, so..:</p><p>11. in build.xml, I change the <code class="code">db.driver.jar.name to </code></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;property name="db.driver.jar.name" value="jtds-1.2.4.jar" /&gt;</span>
</code></pre><p>12. reopen the standalone.xml and make sure the driver name</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;driver&gt;</span>JTDS<span class="jive-xml-tag">&lt;/driver&gt;</span>
</code></pre><p>match with</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag">&lt;drivers&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;driver name="JTDS" module="net.sourceforge.jtds"&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;driver-class&gt;</span>net.sourceforge.jtds.jdbc.Driver<span class="jive-xml-tag">&lt;/driver-class&gt;</span>&#160; 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/driver&gt;</span>
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/drivers&gt;</span>

</code></pre><p>13. open build.xml again, and change the <code class="code">db.driver.module.prefix to</code></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;property name="db.driver.module.prefix" value="net/sourceforge/jtds"/&gt;</span>
</code></pre><p>14. modify the "<code class="code">db/driver_jar_module.xml</code>" (attached as db_driver_jar_module.xml)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag">&lt;module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds"&gt;</span>
&#160;&#160; <span class="jive-xml-tag">&lt;resources&gt;</span>
&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;resource-root path="jtds-1.2.4.jar"/&gt;</span>
&#160;&#160; <span class="jive-xml-tag">&lt;/resources&gt;</span>
&#160;&#160; <span class="jive-xml-tag">&lt;dependencies&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;module name="javax.api"/&gt;</span>
&#160;&#160;&#160;&#160;&#160; <span class="jive-xml-tag">&lt;module name="javax.transaction.api"/&gt;</span>
&#160;&#160;&#160; <span class="jive-xml-tag">&lt;/dependencies&gt;</span>
<span class="jive-xml-tag">&lt;/module&gt;</span>

</code></pre><p>15. ok, up to this step, I tried to run ant install.demo.db</p><p>&#160;&#160;&#160;&#160; and then followed by ant start.demo.db</p><p>The DB Tables are created properly in my MS SQL Server.</p><p>But I cannot use the jbpm-console, it turns out that the jbpm-console has its own persistence.xml that needs to be modified, as does the human task war</p><p>so I go and modify those two persistence.xml (by exploding the war and re-war it again) and fix the hibernate dialect in those two persistence.xml</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>try again with fresh unzip of full installer but still no luck, I still got the resteasy error when opening the jbpm-console, and if I start the sample from eclipse, I got the could not connect to taskclient error, mentioning something about the hornetq.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>anything i miss out?</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/751586#751586">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


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

</div>

</body>
</html>