glassfish
  1. glassfish
  2. GLASSFISH-21043

Glassfish 4 admin gui class loading issue when built from source (as at svn revision 63170)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1
    • Fix Version/s: None
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Description

      The default domain starts without error. Attempting to access the admin application fails with the root cause being failure to locate com.sun.webui.jsf.faces.UIComponentELResolver.
      The class in question exists within $INSTALL_ROOT/lib/install/applications/__admingui/WEB-INF/extra/webui-jsf-4.0.2.10.jar and was compiled using the same JDK I am using to start the container.

      Root cause:

      The current source for sun-web.xml in the __admingui module contains the following:

      <class-loader delegate="true"
      extra-class-path="WEB-INF/extra/webui-jsf-suntheme-4.0.2.10.jar
      :WEB-INF/extra/dojo-ajax-nodemo-0.4.1.jar
      :WEB-INF/extra/webui-jsf-4.0.2.10.jar
      :WEB-INF/extra/commons-fileupload-1.1.1.jar
      :WEB-INF/extra/commons-io-1.3.1.jar
      :WEB-INF/extra/json-1.0.jar
      :WEB-INF/extra/prototype-1.5.0.jar" />

      com.sun.enterprise.glassfish.web.WarHandler.configureLoaderAttributes() does not strip whitespace characters when splitting extra-class-path into path elements.
      See com.sun.enterprise.glassfish.web.WarHandler:286 for details.

      Consequently at line 310:
      URL url = file.toURI().toURL();

      the spaces are URL encoded as %20 before passing the string to:
      cloader.addRepository(url.toString());

      which then silently fails to add the jar to the classpath.
      Strangely addRepository(String) converts the string back to a URL before passing it (eventually) to URLClassPath.addURL(). I don't have the source for this class but it evidently doesn't like the trailing encoded whitespace characters, because after this call returns the classpath has not changed.

      A patch for the issue is attached to https://www.java.net/forum/topic/glassfish/glassfish/glassfish-4-admin-console-class-loading-issue-when-built-source where the problem was first reported.

        Activity

        Hide
        Dave Whitla added a comment -

        When reviewing my changes to commit the fix (to my git clone) I noticed that the reformatting of sun-web.xml had actually been done automagically by my IDE (IntelliJ).
        This explains the issue not affecting others.

        While the conditions were thus self inflicted, I think this is still a latent bug.
        The documentation does state that the extra-class-path consists of path elements separated by ':' or ';' with no explicit allowance for whitespace. However whitespace at the end of a path is perfectly valid and failure to handle it robustly is a future problem. Further, the root cause failure is silent in the shipped configuration, giving new users/developers no clue at all as to why their application fails to load.

        Request that you apply the patch.

        Show
        Dave Whitla added a comment - When reviewing my changes to commit the fix (to my git clone) I noticed that the reformatting of sun-web.xml had actually been done automagically by my IDE (IntelliJ). This explains the issue not affecting others. While the conditions were thus self inflicted, I think this is still a latent bug. The documentation does state that the extra-class-path consists of path elements separated by ':' or ';' with no explicit allowance for whitespace. However whitespace at the end of a path is perfectly valid and failure to handle it robustly is a future problem. Further, the root cause failure is silent in the shipped configuration, giving new users/developers no clue at all as to why their application fails to load. Request that you apply the patch.
        Hide
        Anissa Lam added a comment -

        Thanks for filing and debugging the issue.
        The suspect code is in web container, I am transferring this to that team for further evaluation.
        If we can't load the console, then this is very critical and we will need to upgrade this to P2 and need to be fixed for 4.0.1.

        Show
        Anissa Lam added a comment - Thanks for filing and debugging the issue. The suspect code is in web container, I am transferring this to that team for further evaluation. If we can't load the console, then this is very critical and we will need to upgrade this to P2 and need to be fixed for 4.0.1.
        Hide
        Dave Whitla added a comment - - edited

        Hi Anissa,

        You may have missed that I already have a fix and that, on further analysis, this does not affect all users as first suspected - indeed it is a bit of an edge case.
        I would attach my patch but I don't seem to have permissions to attach files to this bug report.

        Please see the link in my original report for the patch I have created for this issue.

        Show
        Dave Whitla added a comment - - edited Hi Anissa, You may have missed that I already have a fix and that, on further analysis, this does not affect all users as first suspected - indeed it is a bit of an edge case. I would attach my patch but I don't seem to have permissions to attach files to this bug report. Please see the link in my original report for the patch I have created for this issue.
        Hide
        Anissa Lam added a comment -

        Yes, looks like our comments cross each other, with 2 min. difference.
        The web container team will make the decision on how to proceed with the bug.
        thanks.

        Show
        Anissa Lam added a comment - Yes, looks like our comments cross each other, with 2 min. difference. The web container team will make the decision on how to proceed with the bug. thanks.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            Dave Whitla
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: