glassfish
  1. glassfish
  2. GLASSFISH-1505

Illegal class loader binding happens unexpectedly

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.1pe_dev
    • Component/s: web_container
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,505
    • Status Whiteboard:
      Hide

      fixed-pwc12

      Show
      fixed-pwc12

      Description

      I have seen this problem for quite some times and have showed this to
      Jeanfrancois before.
      Here is the step to reproduce this. I was using the latest nightly build
      11/13/2006.

      • Whether you built glassfish or using the installer to install the app server,
        you will find $AS/lib/install/applications/admingui/adminGUI-JSF_war directory
      • Deploy this using deploydir
        asadmin deploydir --contextroot admin-jsf --name admin-jsf
        $AS/lib/install/applications/admingui/adminGUI-JSF_war
      • Deploy another simple war file, eg hello.war
      • Expand the left tree and select hello.war under web applications node. The
        right frame should let you edit this war file entry.
      • put something to the Description text field, click SAVE. Everything is fine.
      • After it shows you 'Save sucessfully' message, add more text to the
        description field again, and click SAVE again.
      • Illegal class loader binding exception is thrown.

      You won't be able to do any Save from now on except to redeploy adminGUI-JSF_war
      again.

      Here is the stack trace:

      [#|2006-11-13T14:50:23.824-0800|SEVERE|sun-appserver-ee9.1|javax.enterprise.system.container.web|_ThreadID=16;_ThreadName=httpWorkerThread-8080-3;_RequestID=ca722e55-46ce-4203-9cb5-407244b2b2cb;|StandardWrapperValve[FacesServlet]:
      PWC1406: Servlet.service() for servlet FacesServlet threw exception
      java.lang.IllegalStateException: Illegal class loader binding
      at
      org.apache.naming.resources.DirContextURLStreamHandler.get(DirContextURLStreamHandler.java:198)
      at
      org.apache.naming.resources.DirContextURLStreamHandler.openConnection(DirContextURLStreamHandler.java:98)
      at java.net.URL.openConnection(URL.java:943)
      at java.net.URL.openStream(URL.java:1007)
      at
      com.sun.jsftemplating.util.ClasspathEntityResolver.resolveEntity(ClasspathEntityResolver.java:135)
      at
      com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper.resolveEntity(EntityResolver2Wrapper.java:174)
      at
      com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:701)
      at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1019)
      at
      com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
      at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
      at
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
      at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
      at
      com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
      at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:123)
      at
      com.sun.jsftemplating.layout.xml.XMLLayoutDefinitionReader.read(XMLLayoutDefinitionReader.java:164)
      at
      com.sun.jsftemplating.layout.xml.XMLLayoutDefinitionManager.getLayoutDefinition(XMLLayoutDefinitionManager.java:159)
      at
      com.sun.jsftemplating.layout.LayoutDefinitionManager.getLayoutDefinition(LayoutDefinitionManager.java:123)
      at
      com.sun.jsftemplating.component.TemplateComponentBase.getLayoutDefinition(TemplateComponentBase.java:159)
      at
      com.sun.jsftemplating.renderer.TemplateRenderer.decode(TemplateRenderer.java:168)
      at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:774)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:994)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989)
      at com.sun.webui.jsf.component.Form.processDecodes(Unknown Source)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989)
      at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:989)
      at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:494)
      at
      com.sun.jsftemplating.layout.LayoutViewRoot.processDecodes(LayoutViewRoot.java:114)
      at
      com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
      at
      org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
      at com.sun.webui.jsf.util.UploadFilter.doFilter(Unknown Source)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
      at
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
      at
      org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:255)
      at
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:186)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1029)
      at
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:586)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:556)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1029)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:249)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:618)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.processNonBlocked(DefaultProcessorTask.java:549)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:790)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:332)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:254)
      at
      com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:205)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
      at
      com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:103)

      #]

        Activity

        Hide
        Jennifer Chou added a comment -

        The new admin-gui is now predeployed. You can access it at
        http://localhost:4848/adminconsole/
        Do the same steps as above to reproduce the problem.
        I was working on a property page and ran into this problem. Exception occurs on
        the 2nd Save. Then you are hosed - have to redeploy admin-gui or restart
        appserver.

        Show
        Jennifer Chou added a comment - The new admin-gui is now predeployed. You can access it at http://localhost:4848/adminconsole/ Do the same steps as above to reproduce the problem. I was working on a property page and ran into this problem. Exception occurs on the 2nd Save. Then you are hosed - have to redeploy admin-gui or restart appserver.
        Hide
        jluehe added a comment -

        This is a bug in the JSF version of the admin gui.

        Notice that when you first update the webapp's description filed and hit SAVE,
        the webapp gets redeployed. However, the next time you update the webapp's
        description
        field and hit SAVE, there is no redeploy event triggered, causing the exception
        you are seeing.

        This is different from the non-JSF version of the admin gui, which triggers a
        redeploy event each time the description field is updated.

        Show
        jluehe added a comment - This is a bug in the JSF version of the admin gui. Notice that when you first update the webapp's description filed and hit SAVE, the webapp gets redeployed. However, the next time you update the webapp's description field and hit SAVE, there is no redeploy event triggered, causing the exception you are seeing. This is different from the non-JSF version of the admin gui, which triggers a redeploy event each time the description field is updated.
        Hide
        jluehe added a comment -

        Reassigning this bug back to myself.

        After further investigation, I found that the classloader associated with
        "/adminconsole" is prematurely being removed from the classloader-to-resource
        mappings.

        Show
        jluehe added a comment - Reassigning this bug back to myself. After further investigation, I found that the classloader associated with "/adminconsole" is prematurely being removed from the classloader-to-resource mappings.
        Hide
        jluehe added a comment -

        Avoid premature removal of classloader-to-resource mapping. Leave a
        classloader's resource bindings intact for as long as the classloader is active:
        Make WebappLoader.start() the only responsible for adding the mapping, and
        WebappLoader.stop() the only code responsible for removing it. No other code
        (such as StandardContext.bindThread() or unbindThread()) should set or remove
        this kind of mapping.

        Checking in StandardContext.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/StandardContext.java,v
        <-- StandardContext.java
        new revision: 1.31; previous revision: 1.30
        done

        Show
        jluehe added a comment - Avoid premature removal of classloader-to-resource mapping. Leave a classloader's resource bindings intact for as long as the classloader is active: Make WebappLoader.start() the only responsible for adding the mapping, and WebappLoader.stop() the only code responsible for removing it. No other code (such as StandardContext.bindThread() or unbindThread()) should set or remove this kind of mapping. Checking in StandardContext.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/StandardContext.java,v <-- StandardContext.java new revision: 1.31; previous revision: 1.30 done
        Hide
        kmeduri added a comment -

        Merged the fix to PWC12Dev_Branch:

        Checking in StandardContext.java;
        /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/StandardContext.java,v
        <-- StandardContext.java
        new revision: 1.22.6.5; previous revision: 1.22.6.4
        done

        Show
        kmeduri added a comment - Merged the fix to PWC12Dev_Branch: Checking in StandardContext.java; /cvs/glassfish/appserv-webtier/src/java/org/apache/catalina/core/StandardContext.java,v <-- StandardContext.java new revision: 1.22.6.5; previous revision: 1.22.6.4 done

          People

          • Assignee:
            jluehe
            Reporter:
            Anissa Lam
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: