4 Replies Latest reply on Jan 12, 2012 7:03 AM by David Robison

    How to make a SAR service dependent on my hibernate class jar

    David Robison Novice

      I am using as7. I have my custom hibernate classes deployed in a jar with a persistence.xml file. I have anoter SAR that I am deploying and I want to make it dependent on the jar with my custom hibernate classes. How would I do this? David

        • 1. Re: How to make a SAR service dependent on my hibernate class jar
          jaikiran pai Master

          What exactly do you mean by custom hibernate classes? Have you tweaked/changed/added classes related to Hibernate implementation or are those just entity classes that belong to your application?

          • 2. Re: How to make a SAR service dependent on my hibernate class jar
            David Robison Novice

            Sorry to be unclear. I am refering to my JAR that contains my classes with the hibernate annotations and the persistence.xml file. I need my SAR to be dependent on this and to load it in its classloader. Here is my jboss-dependency-structure.xml. I am trying to include the dependency to the VATVD-Database-1.0.jar which was deployed separatly and contains my classes with the hibernate annotatiuons and the persistence.xml file.

             

            <jboss-deployment-structure>

                <deployment>

                    <dependencies>

                        <module name="deployment.module.nested" export="true"/>

                        <!-- module name="VATVD-Database-1.0.jar"/ -->

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

                        <module name="org.jboss.as.clustering.api" export="true"/>

                        <module name="org.jboss.as.clustering.impl" export="true"/>

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

                        <module name="org.jboss.as.clustering.service" export="true"/>

                        <module name="org.jboss.as.clustering.singleton" export="true"/>

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

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

                    </dependencies>

                    <resources>

                        <resource-root path="VATVD-Database-1.0.jar" />

                    </resources>

                </deployment>

                <module name="deployment.module.nested">

                    <resources>

                        <resource-root path="activation-1.1.1.jar"/>

                        <resource-root path="commons-codec-1.4.jar"/>

                        <resource-root path="commons-lang-2.6.jar"/>

                        <resource-root path="commons-logging-1.1.1.jar"/>

                        <resource-root path="concurrent-1.3.4.jar"/>

                        <resource-root path="DataGateway-ClientKit-2.0.jar"/>

                        <resource-root path="DataGateway-EDXL-1.0.jar"/>

                        <resource-root path="DataGateway-Toolkit-1.0.jar"/>

                        <resource-root path="jzlib-1.0.7.jar"/>

                        <resource-root path="slf4j-api-1.6.0.jar"/>

                        <resource-root path="slf4j-log4j12-1.6.0.jar"/>

                        <resource-root path="VATVD-DGListener-1.0.jar"/>

                        <resource-root path="xmlBlaster-1.6.2.1.jar"/>

                    </resources>

                </module>

            </jboss-deployment-structure>

            • 3. Re: How to make a SAR service dependent on my hibernate class jar
              jaikiran pai Master

              David Robison wrote:

               

              Sorry to be unclear. I am refering to my JAR that contains my classes with the hibernate annotations and the persistence.xml file. I need my SAR to be dependent on this and to load it in its classloader.

              Is that jar and the sar part of the same .ear? If yes, then you can just place the .jar in the .ear/lib and the .sar at the root level of the .ear and the classes from the .jar will be available to the sar deployment.

               

              Out of curiosity what kind of services does the .sar include?

              • 4. Re: How to make a SAR service dependent on my hibernate class jar
                David Robison Novice

                Actually I was just deploying the SAR, not an EAR. It is a POJO service that needs to run like the old deploy-hasingleton. It simply reads data from an external source and saves it in a database. No one directly accesses this service it just processes data.