3 Replies Latest reply on Feb 10, 2004 1:46 PM by Steve Dodge

    Classloader Issues with Hibernate and UseJBossWebLoader

    Steve Dodge Newbie

      I have 3 war files each using hibernate. Each has its own separate hibernate configuration in WEB-INF/classes/hibernate.cfg.xml. When I use the out-of-box Jboss, the first webapp that I test finds the necessary hibernate resources and everything is fine. Upon execution of the second or third webapp, HibernateExceptions occur in my queries leading me to believe resources for the second webapp are not loaded properly.

      Looking at other posts regarding class loading issues in war files, I see recommendations to configure the UseJBossWebLoader to "false" in jbossweb-tomcat.sar/META-INF/jboss-service.xml. Apparently this should isolate my war classloaders. But when I try this I get java.lang.NoClassDefFoundError for the first Hibernate class I try to load. Strangely, the hibernate2.jar is packaged in WEB-INF/lib in each of the wars.

      Besides setting UseJBossWebLoader to "false", what else should I do to isolate my wars but ensure the hibernate classes are found?


      I've read several posts regarding Jboss classloader issues and the JBoss unified classloader including:

      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=43462
      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=41379
      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=44256

      Steve