glassfish
  1. glassfish
  2. GLASSFISH-17708

WebappClassLoader processes jars in WEB-INF/lib twice

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.2_b10
    • Component/s: web_container
    • Labels:
      None

      Description

      The getURLs() method in WebappClassLoader(web/war-util) returns a list of repositoryURLs. This list, atleast for admin console (and likely for other web applications as well) has the same jars from WEB-INF/lib twice. This results in tldscanner to operate on the same jar twice, impacting performance.

        Activity

        Hide
        Amy Roh added a comment -

        The list of jars returned via WebappClassLoader.getURLs(). [1] is the same as [13] and so on..

        ::repositoryURLs[0]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/classes|#]

        ::repositoryURLs[1]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/ajax-wrapper-comp-1.8.1.jar|#]

        ::repositoryURLs[2]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-fileupload-1.1.1.jar|#]

        ::repositoryURLs[3]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-io-1.3.1.jar|#]

        ::repositoryURLs[4]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/console-core-3.1.2-SNAPSHOT.jar|#]

        ::repositoryURLs[5]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/dojo-ajax-nodemo-0.4.1.jar|#]

        ::repositoryURLs[6]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jMakiResources.jar|#]

        ::repositoryURLs[7]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jsfcompounds-0.0.6.jar|#]

        ::repositoryURLs[8]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/json-1.0.jar|#]

        :repositoryURLs[9]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/prototype-1.5.0.jar|#]

        ::repositoryURLs[10]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-4.0.2.8.jar|#]

        ::repositoryURLs[11]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-suntheme-4.0.2.8.jar|#]

        ::repositoryURLs[12]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/domains/domain1/generated/ejb/__admingui/|#]

        ::repositoryURLs[13]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/ajax-wrapper-comp-1.8.1.jar|#]

        ::repositoryURLs[14]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-fileupload-1.1.1.jar|#]

        ::repositoryURLs[15]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-io-1.3.1.jar|#]

        ::repositoryURLs[16]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/console-core-3.1.2-SNAPSHOT.jar|#]

        ::repositoryURLs[17]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/dojo-ajax-nodemo-0.4.1.jar|#]

        ::repositoryURLs[18]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jMakiResources.jar|#]

        ::repositoryURLs[19]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jsfcompounds-0.0.6.jar|#]

        ::repositoryURLs[20]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/json-1.0.jar|#]

        ::repositoryURLs[21]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/prototype-1.5.0.jar|#]

        ::repositoryURLs[22]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-4.0.2.8.jar|#]

        ::repositoryURLs[23]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-suntheme-4.0.2.8.jar|#]

        ::repositoryURLs[24]= file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/domains/domain1/generated/__admingui/|#]

        Show
        Amy Roh added a comment - The list of jars returned via WebappClassLoader.getURLs(). [1] is the same as [13] and so on.. ::repositoryURLs [0] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/classes |#] ::repositoryURLs [1] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/ajax-wrapper-comp-1.8.1.jar |#] ::repositoryURLs [2] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-fileupload-1.1.1.jar |#] ::repositoryURLs [3] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-io-1.3.1.jar |#] ::repositoryURLs [4] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/console-core-3.1.2-SNAPSHOT.jar |#] ::repositoryURLs [5] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/dojo-ajax-nodemo-0.4.1.jar |#] ::repositoryURLs [6] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jMakiResources.jar |#] ::repositoryURLs [7] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jsfcompounds-0.0.6.jar |#] ::repositoryURLs [8] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/json-1.0.jar |#] :repositoryURLs [9] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/prototype-1.5.0.jar |#] ::repositoryURLs [10] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-4.0.2.8.jar |#] ::repositoryURLs [11] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-suntheme-4.0.2.8.jar |#] ::repositoryURLs [12] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/domains/domain1/generated/ejb/__admingui/ |#] ::repositoryURLs [13] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/ajax-wrapper-comp-1.8.1.jar |#] ::repositoryURLs [14] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-fileupload-1.1.1.jar |#] ::repositoryURLs [15] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/commons-io-1.3.1.jar |#] ::repositoryURLs [16] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/console-core-3.1.2-SNAPSHOT.jar |#] ::repositoryURLs [17] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/dojo-ajax-nodemo-0.4.1.jar |#] ::repositoryURLs [18] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jMakiResources.jar |#] ::repositoryURLs [19] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/jsfcompounds-0.0.6.jar |#] ::repositoryURLs [20] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/json-1.0.jar |#] ::repositoryURLs [21] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/prototype-1.5.0.jar |#] ::repositoryURLs [22] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-4.0.2.8.jar |#] ::repositoryURLs [23] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/lib/install/applications/__admingui/WEB-INF/lib/webui-jsf-suntheme-4.0.2.8.jar |#] ::repositoryURLs [24] = file:/Users/Amy/v3.1.2/3.1.2/distributions/glassfish/target/glassfish3/glassfish/domains/domain1/generated/__admingui/ |#]
        Hide
        Amy Roh added a comment -

        Fix for 11417 addJar (svn 35459) calls super.addURL in addition to adding the jar to WebappClassLoader.jarFiles.

        WebappClassLoader.getURLs returns jarFiles as well as super.getURLs and this includes duplicate jars.

        The fix should remove duplicate jars when returning jars via getURLs.

        Index: war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
        ===================================================================
        — war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java (revision 35458)
        +++ war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java (revision 35459)
        @@ -662,6 +662,9 @@
        if (logger.isLoggable(Level.FINER))
        logger.finer("addJar(" + jar + ")");

        + // See IT 11417
        + super.addURL(getURL(file));
        +
        int i;

        if ((jarPath != null) && (jar.startsWith(jarPath))) {

        Show
        Amy Roh added a comment - Fix for 11417 addJar (svn 35459) calls super.addURL in addition to adding the jar to WebappClassLoader.jarFiles. WebappClassLoader.getURLs returns jarFiles as well as super.getURLs and this includes duplicate jars. The fix should remove duplicate jars when returning jars via getURLs. Index: war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java =================================================================== — war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java (revision 35458) +++ war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java (revision 35459) @@ -662,6 +662,9 @@ if (logger.isLoggable(Level.FINER)) logger.finer("addJar(" + jar + ")"); + // See IT 11417 + super.addURL(getURL(file)); + int i; if ((jarPath != null) && (jar.startsWith(jarPath))) {
        Hide
        Amy Roh added a comment -

        Fixed in 50922 (3.1.2) and 50919 (trunk).

        Show
        Amy Roh added a comment - Fixed in 50922 (3.1.2) and 50919 (trunk).

          People

          • Assignee:
            Amy Roh
            Reporter:
            sirajg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: