2 Replies Latest reply on Oct 9, 2002 2:21 PM by Bryan Rall

    ClassLoader Problem

    Bryan Rall Newbie

      I am having problems with classes that exist in multiple jars/wars deployed to the server. It seems that if the class is loaded by an ejb jar before by war file, the servlet container will use the previously loaded version of the class. It's causing me real problems because the class in question tries to load resources that are jar/war specific. Is there a way around this problem? I seem to get the same behavior if I package the wars and jars in an ear as well.

        • 1. Re: ClassLoader Problem
          John Katilie Newbie

          Under Jboss/Tomcat there is an option in the tomcat4-service.xml to turn off the Java2 class loading. I.e.

          <!-- Uncomment this if you want interval snapshot for the
          session clustering.

          You could try setting the attribute to false.

          Best of luck.

          • 2. Re: ClassLoader Problem
            Bryan Rall Newbie

            I set Java2ClassLoadingCompliance=false and it seemed to fix the classpath problem, but it caused a bunch of other problems. The connection pools that were working before don't seem to be available in the jndi now. I tried to add a resource-ref to the web.xml and jboss-xml.xml to tie resource to the jndi name; but it then I get other timeout exceptions. So, long story short it seemed to cause more problems that it solved. Are there any other things I could try? How are the classloaders organized in jboss? I would tend to think that classes in one jar or war shouldn’t be visible in other packages.