ICEfaces
  1. ICEfaces
  2. ICE-3132

Failed to notify listener: problem when using multiple FF2 windows on Tomcat6 or Jboss4.2 NIO

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces asynchronous applications w/ Tomcat 6 w/ optional NIO configured (or JBoss 4.2.2 with optional NIO configured).
    • Workaround Exists:
      Yes
    • Workaround Description:
      Do not configure NIO for Tomcat / JBoss 4.2.2, use ICEfaces AHS config. instead or plain old blocking IO.

      Description

      When testing auctionMonitor on Tomcat6.o NIO or JBoss4.2 NIO following fails:

      1) 3 FF2 windows- clocks stop ticking

      2) Opera 2 tabs + 1 IE window same problem

      SEVERE: Failed to notify listener: com.icesoft.faces.context.View$3@13c296b
      java.lang.NullPointerException
              at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(C
      ometEventImpl.java:112)
              at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponde
      r.run(TomcatPushServlet.java:295)
              at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17)
              at com.icesoft.faces.context.View$3.run(View.java:76)
              at com.icesoft.faces.context.View.broadcastTo(View.java:195)
              at com.icesoft.faces.context.View.put(View.java:170)
              at com.icesoft.faces.webapp.http.core.ReceivePing.service(ReceivePing.ja

      NOTE: 3+ IE7 windows running auctionMonitor work fine.

      Also when the JBoss4.2 server is first started Following message is seen in the logs:
      2008-06-03 11:03:47,553 ERROR [org.jboss.deployment.scanner.URLDeploymentScanner] Incomplete Deployment listing:

      --- Packages waiting for a deployer ---
      org.jboss.deployment.DeploymentInfo@2a24ff8e { url=file:/C:/MyDownloads/JBoss/jboss-4.2.2.GA-NIO/server/default/deploy/WEB-INF/web.xml }
        deployer: null
        status: null
        state: INIT_WAITING_DEPLOYER
        watch: file:/C:/MyDownloads/JBoss/jboss-4.2.2.GA-NIO/server/default/deploy/WEB-INF/web.xml
        altDD: null
        lastDeployed: 1212512627522
        lastModified: 1212512627522
        mbeans:

      This could have something to do with the changes that were made in the web.xml file for the work around being used for Jboss server as mentioned in the configuration notes:
      " Note: There is a known issue with JBoss 4.2 whereby the default JBoss ReplyHeaderFilter will fail with this configuration. A work-around is to disable the ReplyHeaderFilter via the following configuration change in the ../server/default/deploy/jboss-web.deployer/conf/web.xml file:"

        Activity

        Hide
        Jack Van Ooststroom added a comment -

        SEVERE: Failed to notify listener: com.icesoft.faces.context.View$3@13c296b
        java.lang.NullPointerException
        at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112)
        at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:295)
        at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17)
        at com.icesoft.faces.context.View$3.run(View.java:76)
        at com.icesoft.faces.context.View.broadcastTo(View.java:195)
        at com.icesoft.faces.context.View.put(View.java:170)
        ...

        This exception is thrown because the TomcatPushServlet is invoking the getHttpServletResponse() method on an instance of the CometEvent that has been "recycled" by Tomcat 6, even though the TomcatPushServlet has not send back a response.

        What I discovered so far by adding logging to Tomcat 6' source and rebuilding it:

        • When the TomcatPushServlet receives a CometEvent.READ one of the things it does is read the Entity Body of the Request. If no Response is available the "Request" is parked.
        • At some point, Tomcat 6 seems to be trying to read from the Request as well but detects that no data is available.
        • Because there is no data to read Tomcat 6 will send a CometEvent.END on which the TomcatPushServlet closes the CometEvent which in turn cause the instance to be "recycled".
        • At some point a Response becomes available from the ICEfaces framework. Then when the TomcatPushServlet invokes the getHttpServletResponse() method the NPE is thrown.

        At this point I don't know if this is a bug in the TomcatPushServlet or in Tomcat 6 itself. We should be able to read the incoming data without any consequences, which we do on each incoming Request. Strangely enough this (the NPE) doesn't always seem to happen, only sporadically.

        Show
        Jack Van Ooststroom added a comment - SEVERE: Failed to notify listener: com.icesoft.faces.context.View$3@13c296b java.lang.NullPointerException at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112) at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:295) at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17) at com.icesoft.faces.context.View$3.run(View.java:76) at com.icesoft.faces.context.View.broadcastTo(View.java:195) at com.icesoft.faces.context.View.put(View.java:170) ... This exception is thrown because the TomcatPushServlet is invoking the getHttpServletResponse() method on an instance of the CometEvent that has been "recycled" by Tomcat 6, even though the TomcatPushServlet has not send back a response. What I discovered so far by adding logging to Tomcat 6' source and rebuilding it: When the TomcatPushServlet receives a CometEvent.READ one of the things it does is read the Entity Body of the Request. If no Response is available the "Request" is parked. At some point, Tomcat 6 seems to be trying to read from the Request as well but detects that no data is available. Because there is no data to read Tomcat 6 will send a CometEvent.END on which the TomcatPushServlet closes the CometEvent which in turn cause the instance to be "recycled". At some point a Response becomes available from the ICEfaces framework. Then when the TomcatPushServlet invokes the getHttpServletResponse() method the NPE is thrown. At this point I don't know if this is a bug in the TomcatPushServlet or in Tomcat 6 itself. We should be able to read the incoming data without any consequences, which we do on each incoming Request. Strangely enough this (the NPE) doesn't always seem to happen, only sporadically.
        Hide
        Jack Van Ooststroom added a comment -

        Changed Assignee Priority to P3; either let Ted or Mircea have a look at this as well.

        Show
        Jack Van Ooststroom added a comment - Changed Assignee Priority to P3; either let Ted or Mircea have a look at this as well.
        Hide
        Jack Van Ooststroom added a comment -

        Changed Fix Version(s) to 1.8#DR2

        Show
        Jack Van Ooststroom added a comment - Changed Fix Version(s) to 1.8#DR2
        Hide
        Krashan Brahmanjara added a comment -

        Maybe it is similar problem.

        Strange behaviour I noticed in this case: Native Tomcat 6 (without TomcatPushServelt) + app on icefaces 1.7.1 rev17586 +concurrentvews=true.

        One firefox connect to localhost:8080/app and everything work well
        Second firefox connect to localhost:8080/app and after this first firefox show "Connection lost"

        The same on IE. The problem is not in web browsers . I can connect to the same app on different host's

        Show
        Krashan Brahmanjara added a comment - Maybe it is similar problem. Strange behaviour I noticed in this case: Native Tomcat 6 (without TomcatPushServelt) + app on icefaces 1.7.1 rev17586 +concurrentvews=true. One firefox connect to localhost:8080/app and everything work well Second firefox connect to localhost:8080/app and after this first firefox show "Connection lost" The same on IE. The problem is not in web browsers . I can connect to the same app on different host's
        Hide
        Mandeep Hayher added a comment -

        Retested on ICEFaces trunk revision# 18155 & Tomcat6 NIO
        1) 3 FF3 windows- everything works fine the clocks continue to tick
        2) Opera 2 tabs + 1 IE - everything works fine the clocks continue to tick

        However following was seen in the appliction log file:
        SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /auctionMonitor.jspx) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@15cb235]
        Jan 8, 2009 1:20:02 PM com.sun.faces.lifecycle.Phase doPhase

        Retested on ICEFaces trunk revision# 18155 & Jboss4.2 NIO
        The clocks continued to tick on all browser, However following was seen on the application server:

        2009-01-08 13:34:59,038 WARN [javax.enterprise.resource.webcontainer.jsf.lifecycle] executePhase(RENDER_RESPONSE 6,com.icesoft.faces.context.BridgeFacesContext@b0838a) threw exception
        java.lang.NullPointerException
        at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112)
        at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:293)
        at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17)
        at com.icesoft.faces.context.View.put(View.java:130)
        at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:95)
        at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:756)
        at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:165)
        at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:533)
        at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:175)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:299)
        at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
        2009-01-08 13:34:59,178 DEBUG [com.icesoft.faces.webapp.xmlhttp.PersistentFacesState] transient render failure for View[Ap9oboO6tdUMboHrJmlx-g:2]
        javax.faces.FacesException: java.lang.NullPointerException
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:306)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:175)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:299)
        at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
        Caused by: java.lang.NullPointerException
        at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112)
        at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:293)
        at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17)
        at com.icesoft.faces.context.View.put(View.java:130)
        at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:95)
        at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:756)
        at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:165)
        at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:533)
        at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        ... 7 more

        2009-01-08 13:34:59,194 DEBUG [com.icesoft.applications.faces.auctionMonitor.beans.ClockBean] ClockBean Transient Rendering exception:
        com.icesoft.faces.webapp.xmlhttp.TransientRenderingException: transient render failure for View[Ap9oboO6tdUMboHrJmlx-g:2]
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.transientRenderingException(PersistentFacesState.java:489)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.throwRenderingException(PersistentFacesState.java:501)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:177)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:299)
        at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
        at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
        at java.lang.Thread.run(Thread.java:595)
        Caused by: javax.faces.FacesException: java.lang.NullPointerException
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:306)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
        at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:175)
        ... 5 more
        Caused by: java.lang.NullPointerException
        at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112)
        at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:293)
        at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17)
        at com.icesoft.faces.context.View.put(View.java:130)
        at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:95)
        at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:756)
        at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:165)
        at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:533)
        at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
        ... 7 more

        Show
        Mandeep Hayher added a comment - Retested on ICEFaces trunk revision# 18155 & Tomcat6 NIO 1) 3 FF3 windows- everything works fine the clocks continue to tick 2) Opera 2 tabs + 1 IE - everything works fine the clocks continue to tick However following was seen in the appliction log file: SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /auctionMonitor.jspx) Exception thrown during phase execution: javax.faces.event.PhaseEvent [source=com.sun.faces.lifecycle.LifecycleImpl@15cb235] Jan 8, 2009 1:20:02 PM com.sun.faces.lifecycle.Phase doPhase Retested on ICEFaces trunk revision# 18155 & Jboss4.2 NIO The clocks continued to tick on all browser, However following was seen on the application server: 2009-01-08 13:34:59,038 WARN [javax.enterprise.resource.webcontainer.jsf.lifecycle] executePhase(RENDER_RESPONSE 6,com.icesoft.faces.context.BridgeFacesContext@b0838a) threw exception java.lang.NullPointerException at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112) at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:293) at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17) at com.icesoft.faces.context.View.put(View.java:130) at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:95) at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:756) at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:165) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:533) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:175) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:299) at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:595) 2009-01-08 13:34:59,178 DEBUG [com.icesoft.faces.webapp.xmlhttp.PersistentFacesState] transient render failure for View [Ap9oboO6tdUMboHrJmlx-g:2] javax.faces.FacesException: java.lang.NullPointerException at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:306) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:175) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:299) at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.NullPointerException at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112) at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:293) at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17) at com.icesoft.faces.context.View.put(View.java:130) at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:95) at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:756) at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:165) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:533) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) ... 7 more 2009-01-08 13:34:59,194 DEBUG [com.icesoft.applications.faces.auctionMonitor.beans.ClockBean] ClockBean Transient Rendering exception: com.icesoft.faces.webapp.xmlhttp.TransientRenderingException: transient render failure for View [Ap9oboO6tdUMboHrJmlx-g:2] at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.transientRenderingException(PersistentFacesState.java:489) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.throwRenderingException(PersistentFacesState.java:501) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:177) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:299) at com.icesoft.faces.async.render.RunnableRender.run(RunnableRender.java:143) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:595) Caused by: javax.faces.FacesException: java.lang.NullPointerException at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:306) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.render(PersistentFacesState.java:175) ... 5 more Caused by: java.lang.NullPointerException at org.apache.catalina.connector.CometEventImpl.getHttpServletResponse(CometEventImpl.java:112) at com.icesoft.faces.webapp.http.servlet.TomcatPushServlet$EventResponder.run(TomcatPushServlet.java:293) at com.icesoft.faces.webapp.http.core.ViewQueue.put(ViewQueue.java:17) at com.icesoft.faces.context.View.put(View.java:130) at com.icesoft.faces.context.PushModeSerializer.serialize(PushModeSerializer.java:95) at com.icesoft.faces.context.BridgeFacesContext$SaveCurrentDocument.serialize(BridgeFacesContext.java:756) at com.icesoft.faces.context.DOMResponseWriter.endDocument(DOMResponseWriter.java:165) at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:533) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) ... 7 more
        Hide
        Mandeep Hayher added a comment -

        Retested with FF2, The clocks worked fine.
        It seems the messages seen on the server as reported in previous comment are related to running the application on Opera browser.

        Show
        Mandeep Hayher added a comment - Retested with FF2, The clocks worked fine. It seems the messages seen on the server as reported in previous comment are related to running the application on Opera browser.

          People

          • Assignee:
            Unassigned
            Reporter:
            Mandeep Hayher
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: