Geronimo
  1. Geronimo
  2. GERONIMO-2503

Webapp classloader prefers WEB-INF/lib over WEB-INF/classes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1, 1.1.1
    • Fix Version/s: 1.1.2, 1.2, 2.0.3, 2.1
    • Component/s: web
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      windows and linux, jetty and tomcat

    • Patch Info:
      Patch Available

      Description

      Application classloader looks in WAR's WEB-INF/lib before WEB-INF/classes. This is in violation of servlet 2.4 (and 2.3) specification, 9.5 Directory Structure, which states:
      "TheWeb application class loader must load classes from the WEB-INF/ classes directory first, and then from library JARs in the WEB-INF/lib directory."

      This behaviour prevents web application from overriding classes and resources from included libraries.

      1. patch.txt
        1 kB
        Nikla Ratinen
      2. test.war
        3 kB
        Nikla Ratinen

        Activity

        Hide
        Nikla Ratinen added a comment -

        A minimal web application to demonstrate the issue. Should print "Servlet loaded from WEB-INF/classes" to System.out when servlet class loaded from WEB-INF/classes.

        Also, a patch against org.apache.geronimo.web.deployment.AbstractWebModuleBuilder to change classloading order.

        Show
        Nikla Ratinen added a comment - A minimal web application to demonstrate the issue. Should print "Servlet loaded from WEB-INF/classes" to System.out when servlet class loaded from WEB-INF/classes. Also, a patch against org.apache.geronimo.web.deployment.AbstractWebModuleBuilder to change classloading order.
        Hide
        Rick McGuire added a comment -

        Fixed in version 1.1.x

        Committed revision 465625.

        Fixed in trunk

        Committed revision 465638.

        Show
        Rick McGuire added a comment - Fixed in version 1.1.x Committed revision 465625. Fixed in trunk Committed revision 465638.
        Hide
        Dain Sundstrom added a comment -

        This fix broke deployment of any war file that kept the Servlet implementation classes in WEB-INF/classes. I fixed this in GERONIMO-2511.

        Show
        Dain Sundstrom added a comment - This fix broke deployment of any war file that kept the Servlet implementation classes in WEB-INF/classes. I fixed this in GERONIMO-2511 .
        Hide
        Ashish Jain added a comment -

        This fix is broken in AG 2.0.1 as well as AG 2.0.2

        Show
        Ashish Jain added a comment - This fix is broken in AG 2.0.1 as well as AG 2.0.2
        Hide
        Shiva Kumar H R added a comment -

        Reopening as requested by Ashish.

        Show
        Shiva Kumar H R added a comment - Reopening as requested by Ashish.
        Hide
        Vamsavardhana Reddy added a comment -

        Rev 465638 did not go into the web 2.5 builder code which was in sandbox then.

        Show
        Vamsavardhana Reddy added a comment - Rev 465638 did not go into the web 2.5 builder code which was in sandbox then.
        Hide
        Vamsavardhana Reddy added a comment -

        Completed: At revision: 609569 in branches\2.0 and trunk (2.1)

        Show
        Vamsavardhana Reddy added a comment - Completed: At revision: 609569 in branches\2.0 and trunk (2.1)

          People

          • Assignee:
            Vamsavardhana Reddy
            Reporter:
            Nikla Ratinen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development