2 Replies Latest reply on Aug 27, 2004 1:05 PM by Pedro Salazar

    classloading isolation

    Pedro Salazar Newbie

      Greetings,

      I'm trying to isolate my web app as described in http://www.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration.

      The classloader's SourceCode is a good way to verify it. But another good test to verify it is using log4j inside my web application file (WEB-INF/lib/log4j.jar and WEB-INF/classes/log4j.xml). Depending of the classloader, the global configuration or the local configuration is used, and we can see how it's working.

      If I set in $jboss_home/server/all/deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml the following attributes to false:

      <attribute name="Java2ClassLoadingCompliance">false</attribute>
      <attribute name="UseJBossWebLoader">false</attribute>
      


      I works just fine, just I expect (isolation is OK).

      However, I would like to let them to true by default, and to set it only the applications I require to be independent using the following syntax:

      <!-- for EAR -->
      <jboss-app>
       <loader-repository>teste:loader=v1.war
       <loader-repository-config>
       java2ParentDelegation=false
       </loader-repository-config>
       </loader-repository>
      </jboss-app>
      
      <!-- for WAR -->
      <jboss-web>
       <class-loading java2ClassLoadingCompliance="false">
       <loader-repository>
       teste:loader=v1.war
       <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
       </loader-repository>
       </class-loading>
      </jboss-web>
      


      The isolation isn't achieved. I mean, log4j is loaded by global jboss classloader (log4j-boot.jar) and consequently, the logger configuration used is the jboss log4j.

      However, I can see that a domain "teste" is created for (teste:loader=v1.war).

      It appears that only the configuration defined in jboss web sar ($jboss_home/server/all/deploy/jbossweb-tomcat50.sar/META-INF/jboss-service.xml ) is valid and the jboss descriptors in EAR or WAR are ignored.

      What is the behavior of the classloading in jboss? Can't I use the jboss descriptors to overried the jboss web SAR?

      I'm using jboss 3.2.5.

      Regards,
      Pedro Salazar.