Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-1551

Classloader bug (version > 3.2.3)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBossAS-4.0.2 Final
    • JBossAS-3.2.7 Final, JBossAS-4.0.1 Final
    • None
    • None

    Description

      Bug did not exist in version 3.2.3. It is present in (at least) 3.2.6 and 4.0.1. Bug may be a simple "documentation bug" caused by not updating published configuration instructions after making a server change.

      Bug: It is no longer possible to run an application in its own classloader instead of the unified classloader, even when configured in an EAR according to published jBoss instructions for private classloaders.

      The following test application was confirmed to work with 3.2.3 but have .jar conflicts with jBoss 3.2.6 and 4.0.1 (commons-logging.jar to be specific) at deployment time. The conflicts would not occur if there classloader isolation worked correctly.

      coA.ear:

      • coA.war:
          • index.jsp
          • META-INF/Manifest.mf
          • WEB-INF/web.xml
          • WEB-INF/classes/coLog4j.xml (not used at this point)
          • WEB-INF/classes/TestServlet.class
          • WEB-INF/lib/commons-logging.jar
          • WEB-INF/lib/log4j-1.2.9.jar
      • META-INF/application.xml
      • META-INF/jboss-app.xml
      • META-INF/Manifest.mf
      • Manifest.mf (both are default ant manifests with no manual content)
      • application.xml:
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
        <application id="Application_ID">
        <display-name>Test A</display-name>
        <module>
        <web>
        <web-uri>coA.war</web-uri>
        <context-root>coA</context-root>
        </web>
        </module>
        </application>
      • jboss-app.xml:
        <?xml version="1.0"?>
        <jboss-app>
        <loader-repository>
        coa.akuratus.com:loader=coA.ear
        <loader-repository-config>
        java2ParentDelegation=false
        </loader-repository-config>
        </loader-repository>
        </jboss-app>
      • web.xml:
        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
        <web-app id="WebApp">
        <display-name>coA</display-name>
        <servlet>
        <servlet-name>log4jTest</servlet-name>
        <servlet-class>TestServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        </servlet>
        <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        </web-app>
      • TestServlet.java:
        import javax.servlet.http.HttpServlet;
        import org.apache.log4j.Logger;
        public class TestServlet extends HttpServlet {
        public static String hello = "HELLO 1";
        public void init() { System.out.println("\n\n"+hello+"\n\n"); }

        }

      An identical setup was made for coB.ear, but with "HELLO 2" as the
      string for the servlet. In 3.2.3 both ears can be loaded and unloaded
      with no exceptions, and the proper strings displaying at load time.

      Attachments

        1. coA.ear
          2.96 MB
        2. coA.ear
          388 kB
        3. coB.ear
          389 kB
        4. CoConfig.hbm.xml
          0.8 kB
        5. CoConfig.java
          2 kB
        6. CoConfigCreateSQL.txt
          3 kB
        7. coLog4j.xml
          3 kB
        8. TestServlet.java
          4 kB
        9. TestServlet.java
          0.2 kB

        Issue Links

          Activity

            People

              starksm64 Scott Stark (Inactive)
              bmelloni_jira Bruno Melloni (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: