5 Replies Latest reply on May 31, 2006 4:16 PM by Peter Johnson

    Hibernate and webservice deployment

    Peter Buus Newbie

      Hi

      I built a webservice using jbossws and packed it in a war ws.war
      I built a hibernate persistence layer on some domain classes and packed it in a har hibernate.har

      Now I want to deploy both archives in a single ear file - but that leaves the domain classes in hibernate.har invisible (ClassNotFoundException) to my webservice.

      I've tried a few workarounds - but nothing seems to work.
      What is the recommended way of packaging my ear so the webservice in ws.war has classloader access to my hibernate domain classes?

      /Peter

        • 1. Re: Hibernate and webservice deployment
          Peter Johnson Master

          Here is what I did. In my har file I have only the hibernate-service.xml file and the maping (*.hbm.xml) files. In my ear file I have the har file, a jar file that contains the data model (all the data classes, the hibernate DAO classes, etc.), the war file, and another jar file that contains the ejb and web service related classes.

          • 2. Re: Hibernate and webservice deployment
            Peter Buus Newbie

            I think I did try that approach - how do you specify the har/war deployer to include the jar file with the common classes?

            • 3. Re: Hibernate and webservice deployment
              Peter Johnson Master

              I only thing I can see is that my application.xml file contains:

              <application ...>
               <module>
               <web>
               <web-uri>xxxx.war</web-uri>
               <context-root>xxxx</context-root>
               </web>
               </module>
               <module>
               <java>xxxx_data.jar</java>
               </module>
               <module>
               <java>xxxx_ejb.jar</java>
               </module>
              </application>


              and my jboss-ap.xml file contains:

              <jboss-app>
               <module>
               <har>xxxx_data.har</har>
               </module>
              </jboss-app>


              There is nothing in the xxxx_data.har file that references the xxxx_data.jar file, though of course the *.hbm.xml files contain entries that reference classes in xxxx_data.jar.

              I just now noticed that that xxxx_data.jar file contains a hibernate.cfg.xml file in the base directory. Also, the *.hbm.xml files appear in xxxx_data.jar (so they are in two places).

              • 4. Re: Hibernate and webservice deployment
                Peter Buus Newbie

                Hmm - it does'nt work for me.

                Did you do any Class-Path references to xxxx_data.jar in your manifest.mf files?
                What version of jboss are you running?
                I'm running 4.0.4 - is my feeling that the jboss classloader strategy is a moving target valid?

                • 5. Re: Hibernate and webservice deployment
                  Peter Johnson Master

                  All of my manifest.mf file are plain, no classpaths there.

                  I have run on 4.0.3SP1 and 4.0.4RC2 (for the later I had to switch back to the axis-based web services as noted in the readme.html). I haven't had the chance to convert my code to the newer JBossWS architecture. (I based my code on the Web Services chapter of JBoss at Work: A Practical Guide by Marrs and Davis.)