<!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;"> </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;"> </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>    I made change from:</p><p>     </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment"><!-- Download Eclipse --></span>
  <span class="jive-xml-tag"><condition property="download.type" value="win32"></span>
    <span class="jive-xml-tag"><os family="windows" /></span>
  <span class="jive-xml-tag"></condition></span>
</code></pre><p> to</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-comment"><!-- Download Eclipse --></span>
  <span class="jive-xml-tag"><condition property="download.type" value="win32-x86_64"></span>
    <span class="jive-xml-tag"><os family="windows" /></span>
  <span class="jive-xml-tag"></condition></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;"> </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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/></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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/></span>
      <span class="jive-xml-tag"><property name="hibernate.connection.driver_class" value="net.sourceforge.jtds.jdbc.Driver"/></span>
      <span class="jive-xml-tag"><property name="hibernate.connection.url" value="jdbc:jtds:sqlserver://DBName:1433/MyTaskDB" /></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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><datasources></span>
                <span class="jive-xml-tag"><datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" jta="true" use-java-context="true" use-ccm="true"></span>
                    <span class="jive-xml-tag"><connection-url></span>jdbc:jtds:sqlserver://DBName:1433/MyJBPMDB<span class="jive-xml-tag"></connection-url></span>
                    <span class="jive-xml-tag"><driver></span>JTDS<span class="jive-xml-tag"></driver></span>
                    <span class="jive-xml-tag"><pool></span>
                        <span class="jive-xml-tag"><min-pool-size></span>1<span class="jive-xml-tag"></min-pool-size></span>
                        <span class="jive-xml-tag"><max-pool-size></span>4<span class="jive-xml-tag"></max-pool-size></span>
                        <span class="jive-xml-tag"><prefill></span>false<span class="jive-xml-tag"></prefill></span>
                        <span class="jive-xml-tag"><use-strict-min></span>false<span class="jive-xml-tag"></use-strict-min></span>
                        <span class="jive-xml-tag"><flush-strategy></span>FailingConnectionOnly<span class="jive-xml-tag"></flush-strategy></span>
                    <span class="jive-xml-tag"></pool></span>
                    <span class="jive-xml-tag"><security></span>
                       <span class="jive-xml-tag"><user-name></span>test<span class="jive-xml-tag"></user-name></span>
                       <span class="jive-xml-tag"><password></span>12345<span class="jive-xml-tag"></password></span>
                    <span class="jive-xml-tag"></security></span>
                    <span class="jive-xml-tag"><validation></span>
                       <span class="jive-xml-tag"><check-valid-connection-sql></span>SELECT 1<span class="jive-xml-tag"></check-valid-connection-sql></span>
                       <span class="jive-xml-tag"><validate-on-match></span>false<span class="jive-xml-tag"></validate-on-match></span>
                       <span class="jive-xml-tag"><background-validation></span>false<span class="jive-xml-tag"></background-validation></span>
                    <span class="jive-xml-tag"></validation></span>
                <span class="jive-xml-tag"></datasource></span>
                <span class="jive-xml-tag"><drivers></span>
                   <span class="jive-xml-tag"><driver name="JTDS" module="net.sourceforge.jtds"></span>
                            <span class="jive-xml-tag"><driver-class></span>net.sourceforge.jtds.jdbc.Driver<span class="jive-xml-tag"></driver-class></span> 
                    <span class="jive-xml-tag"></driver></span>
                <span class="jive-xml-tag"></drivers></span>
            <span class="jive-xml-tag"></datasources></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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><property name="db.driver.jar.name" value="jtds-1.2.4.jar" /></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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><driver></span>JTDS<span class="jive-xml-tag"></driver></span>
</code></pre><p>match with</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"> <span class="jive-xml-tag"><drivers></span>
                   <span class="jive-xml-tag"><driver name="JTDS" module="net.sourceforge.jtds"></span>
                            <span class="jive-xml-tag"><driver-class></span>net.sourceforge.jtds.jdbc.Driver<span class="jive-xml-tag"></driver-class></span> 
                    <span class="jive-xml-tag"></driver></span>
                <span class="jive-xml-tag"></drivers></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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><property name="db.driver.module.prefix" value="net/sourceforge/jtds"/></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;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><module xmlns="urn:jboss:module:1.0" name="net.sourceforge.jtds"></span>
   <span class="jive-xml-tag"><resources></span>
     <span class="jive-xml-tag"><resource-root path="jtds-1.2.4.jar"/></span>
   <span class="jive-xml-tag"></resources></span>
   <span class="jive-xml-tag"><dependencies></span>
      <span class="jive-xml-tag"><module name="javax.api"/></span>
      <span class="jive-xml-tag"><module name="javax.transaction.api"/></span>
    <span class="jive-xml-tag"></dependencies></span>
<span class="jive-xml-tag"></module></span>
</code></pre><p>15. ok, up to this step, I tried to run ant install.demo.db</p><p>     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;"> </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;"> </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>