ICEfaces
  1. ICEfaces
  2. ICE-5710

CompatDOMResponseWriter throws NullPointerException when attempting to process subtrees

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha2
    • Fix Version/s: 2.0-Alpha3, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces 2 JSF 2

      Description

      When running the glimmer/samples/test/nav, if you click on the example buttons that use the f:ajax tag to do a postback call to the same page and the rendering is targetted to a subtree, the following exception occurs:

      [#|2010-05-12T14:09:46.797-0700|SEVERE|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=27;_ThreadName=Thread-1;|java.lang.NullPointerException
      at com.icesoft.faces.component.CompatDOMResponseWriter.endDocument(CompatDOMResponseWriter.java:51)
      at org.icefaces.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:151)
      at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:989)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:369)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
      at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
      at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
      at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
      at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
      at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
      at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
      at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
      at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
      at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
      at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
      at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
      at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
      at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
      at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
      at java.lang.Thread.run(Thread.java:637)
      |#]

      The code in CompatDOMResponseWriter that has the problem is the section that attempts to locate a "body" node:

              Node body = document.getElementsByTagName("body").item(0);
              Element div = (Element) body.appendChild(document.createElement("div"));

      which is highly unlikely to be available during subtree rendering.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Assigning to Ted for initial investigation since he is the original author of the subtree rendering code.

        Show
        Deryk Sinotte added a comment - Assigning to Ted for initial investigation since he is the original author of the subtree rendering code.
        Hide
        Ted Goddard added a comment -

        I have added icefaces-compat.jar to this application and have reproduced the exception.

        Show
        Ted Goddard added a comment - I have added icefaces-compat.jar to this application and have reproduced the exception.
        Hide
        Ted Goddard added a comment -

        Will modify this to be a SystemEvent listener analogous to BridgeSetup.

        Show
        Ted Goddard added a comment - Will modify this to be a SystemEvent listener analogous to BridgeSetup.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: