0 Replies Latest reply: Feb 1, 2013 11:06 AM by 988620 RSS

    WAR within EAR is using the same classloader as the EAR

    988620
      Hi all,

      From documentation, I understand that each WAR web application that are packaged within EAR should have a separate (child) classloader and should not be using the same classloader as the EAR. I have two WAR files and some JAR files all packaged and deployed as an EAR. Using the Classloader Analysis Tool, I think the two web applications (WARs) are actually using the same classloader as the EAR. I say this because:
      1. The application class loader listed for the web apps has the same hashcode as the class loader listed for the EAR.
      2. I tried to add the <prefer-web-inf-classes> element within the WAR's weblogic.xml file and it doesn't seem to work. The web app is still using classes loaded in the EAR. This is consistent with my observation that the classloader for the WARs has the same hashcode as the classloader for the EAR - therefore I think they are using the same classloader.

      I don't understand this behavior. I thought WARs are supposed to be using different/child classloaders from the EAR by default. Do I have to specifically declare my own customer <classloader-structure> within weblogic-application.xml in order to have child classloaders for the WARs within my EAR?

      Thanks for any help.