1 Reply Latest reply on Feb 17, 2017 7:22 AM by shpsgm

    Deploying JBPM 3.2.6 within Wildfly 10

    fambad

      Hi,

       

      I have a huge problem. I have to migrate our server code from JBoss 6.0 to Wildfly 10. A lot of the problems I had I have solved but our jbpm integration did not work. So let me describe the problem.

       

      We are using jbpm 3.2.6. This version of jbpm uses hibernate 3.2.x. The wildfly starts with hibernate 5.x and the rest of our server code should use the latest hibernate version 5.x. And only the jbpm module should run with hibernate 3.2. I tried to exclude hibernate 5.x from jbpm sub deployment and include the module hibernate 3.2 but wildfly takes the libs from hibernate 5.x. So how I have to deploy our application.

       

      Our application server deployment looks as follow (I left out the other modules which are not for interest here)

       

      app.ear

        | -- lib (contains some internal libs, all other external libs are defined as modules)

        | -- META-INF (contains the deployment descriptors)

        | -- app-bpm.jar (contains own ejb services that are addressed by the rest of the application and extensions of the jbpm-jpdl.jar which shall use the hibernate 3 libs

        | -- jbpm-jpdl.jar (the jbpm library which shall use hibernate 3)

        | -- .... more modules using hibernate 5

       

       

      My jboss-deployment-structure.xml

       

      <jboss-deployment-structure
         xmlns="urn:jboss:deployment-structure:1.3">

       

         <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

       

         <deployment>

         <dependencies>

         <module name="my-libs" export="true" />

         <module name="org.apache.log4j" export="true" />

         <module name="org.hibernate" slot="5.0" export="true" />

         <module name="org.infinispan" export="true" />

         <module name="org.jboss.ejb3" export="true" />

         <module name="org.jboss.ejb-client" export="true" />

         <module name="org.jboss.remote-naming" export="true" />

         </dependencies>

         </deployment>

       

       

         <sub-deployment name="app-bpm.jar">

         <exclusions>

         <module name="org.hibernate" slot="5.0"/>

         </exclusions>

         <dependencies>

         <module name="org.hibernate" slot="3.2" />

         <!--<module name="deployment.jbpm" />-->
         </dependencies>

         <resources>

         <resource-root path="jbpm-jpdl.jar" />

         </resources>

         </sub-deployment>

       

      <!-- Defining jbpm-jpdl.jar as separate module did also not work -->

         <!--<module name="deployment.jbpm" >-->
        <!--<resources>-->
        <!--<resource-root path="jbpm-jpdl.jar" />-->
        <!--</resources>-->
        <!--<dependencies>-->
        <!--<module name="org.hibernate" slot="3.2" />-->
        <!--</dependencies>-->
        <!--</module>-->

      </jboss-deployment-structure>


      My application.xml:


      <application xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd"
         version="6">


         <module>

         <java>jbpm-jpdl.jar</java>

         </module>

       

         <module>

         <ejb>pos-bpm.jar</ejb>

         </module>

       

      </application>


      JBPM Loads an own hibnerate configuration file which contains the references to the*.hbm.xml files to load the entities. But event at this point org.hibernate.cfg.Configuration.buildSessionFactory() the libraries of hibernate 5 are used.


      So what can I do, that only the bpm module uses the hibernate 3 libs and the rest of the app server uses hibernate 5.