Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3743

NPEs while using two event queues with Comet server push

XMLWordPrintable

    • ZK 8.5.1 R1

      We are using two event queues with different scopes. Each event queue updates a ListModelList by receiving published events. Here is a fiddle for better understanding:

      http://zkfiddle.org/sample/3q9cmm2/1-contemporaneous-application-and-desktop-scope-event-queues#source-2

      We cannot reproduce the NullPointerExceptions there, but we assume it depends on the used server push technique! It is all fine while using polling (like in the fiddle), but we are using Comet as default (which is not usable in the fiddle) server push. This results in a stack trace like this:

      2017-09-14 08:00:49,927 [Thread-95]                       ERROR  o.z.zk.ui.impl.UiEngineImpl.handleError():                   
      java.lang.NullPointerException: null
      	at org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1568) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.Request.setAttribute(Request.java:1559) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:541) ~[catalina.jar:7.0.75]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at org.zkoss.zk.ui.http.ExecutionImpl.setAttribute(ExecutionImpl.java:497) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.Utils.getComponentInfos(Utils.java:120) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.Utils.setComponentInfo(Utils.java:129) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:137) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:919) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:889) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:776) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.access$800(UiEngineImpl.java:128) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl$TemplateImpl.create(UiEngineImpl.java:2318) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.impl.BindListitemRenderer.render(BindListitemRenderer.java:79) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.zul.Listbox$Renderer.render(Listbox.java:2769) ~[zul-8.0.5.jar:8.0.5]
      	at org.zkoss.zul.Listbox.doInitRenderer(Listbox.java:2584) ~[zul-8.0.5.jar:8.0.5]
      	at org.zkoss.zul.Listbox.onInitRender(Listbox.java:2537) ~[zul-8.0.5.jar:8.0.5]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
      	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3146) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3077) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1846) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1618) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.endUpdate(UiEngineImpl.java:1222) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zkex.ui.comet.CometServerPush.deactivate(CometServerPush.java:522) [zkex-8.0.5.jar:na]
      	at org.zkoss.zk.ui.impl.DesktopImpl.deactivateServerPush(DesktopImpl.java:1596) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.Executions.deactivate(Executions.java:1011) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.event.impl.DesktopEventQueue$AsyncListenerThread.run(DesktopEventQueue.java:230) [zk-8.0.5.jar:8.0.5]
      2017-09-14 08:00:50,054 [Thread-131]                      ERROR  o.z.zk.ui.impl.UiEngineImpl.getResponses():                  
      java.lang.NullPointerException: null
      	at org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1568) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.Request.setAttribute(Request.java:1559) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:541) ~[catalina.jar:7.0.75]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at org.zkoss.web.servlet.Servlets.getUserAgent(Servlets.java:818) ~[zweb-8.0.5.jar:8.0.5]
      	at org.zkoss.web.servlet.Servlets.isBrowser(Servlets.java:516) ~[zweb-8.0.5.jar:8.0.5]
      	at org.zkoss.zul.impl.MeshElement.isNativeScrollbar(MeshElement.java:252) ~[zul-8.0.5.jar:8.0.5]
      	at org.zkoss.zul.impl.MeshElement.renderProperties(MeshElement.java:287) ~[zul-8.0.5.jar:8.0.5]
      	at org.zkoss.zul.Listbox.renderProperties(Listbox.java:3307) ~[zul-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2156) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1003) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:699) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1531) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.endUpdate(UiEngineImpl.java:1230) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zkex.ui.comet.CometServerPush.deactivate(CometServerPush.java:522) [zkex-8.0.5.jar:na]
      	at org.zkoss.zk.ui.impl.DesktopImpl.deactivateServerPush(DesktopImpl.java:1596) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.Executions.deactivate(Executions.java:1011) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.event.impl.DesktopEventQueue$AsyncListenerThread.run(DesktopEventQueue.java:230) [zk-8.0.5.jar:8.0.5]
      2017-09-14 08:00:50,072 [Thread-139]                      ERROR  o.z.zk.ui.impl.UiEngineImpl.handleError():                   
      java.lang.NullPointerException: null
      	at org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1568) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.Request.setAttribute(Request.java:1559) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:541) ~[catalina.jar:7.0.75]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at org.zkoss.zk.ui.http.ExecutionImpl.setAttribute(ExecutionImpl.java:497) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zkmax.bind.impl.BindUiLifeCycleExtension.getLifeCycleHandlingSet(BindUiLifeCycleExtension.java:58) ~[zkmax-8.0.5.jar:na]
      	at org.zkoss.zkmax.bind.impl.BindUiLifeCycleExtension.markLifeCycleHandling(BindUiLifeCycleExtension.java:37) ~[zkmax-8.0.5.jar:na]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.reInitBinder0(BindUiLifeCycle.java:168) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.reInitBinder(BindUiLifeCycle.java:108) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.access$000(BindUiLifeCycle.java:55) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle$2.onEvent(BindUiLifeCycle.java:99) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3165) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3113) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3077) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1846) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1618) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.endUpdate(UiEngineImpl.java:1222) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zkex.ui.comet.CometServerPush.deactivate(CometServerPush.java:522) [zkex-8.0.5.jar:na]
      	at org.zkoss.zk.ui.impl.DesktopImpl.deactivateServerPush(DesktopImpl.java:1596) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.Executions.deactivate(Executions.java:1011) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.event.impl.DesktopEventQueue$AsyncListenerThread.run(DesktopEventQueue.java:230) [zk-8.0.5.jar:8.0.5]
      2017-09-14 08:00:50,087 [Thread-147]                      ERROR  o.z.zk.ui.impl.UiEngineImpl.handleError():                   
      java.lang.NullPointerException: null
      	at org.apache.catalina.connector.Request.notifyAttributeAssigned(Request.java:1568) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.Request.setAttribute(Request.java:1559) ~[catalina.jar:7.0.75]
      	at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:541) ~[catalina.jar:7.0.75]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:239) ~[servlet-api.jar:3.0.FR]
      	at org.zkoss.zk.ui.http.ExecutionImpl.setAttribute(ExecutionImpl.java:497) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zkmax.bind.impl.BindUiLifeCycleExtension.getLifeCycleHandlingSet(BindUiLifeCycleExtension.java:58) ~[zkmax-8.0.5.jar:na]
      	at org.zkoss.zkmax.bind.impl.BindUiLifeCycleExtension.markLifeCycleHandling(BindUiLifeCycleExtension.java:37) ~[zkmax-8.0.5.jar:na]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.reInitBinder0(BindUiLifeCycle.java:168) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.reInitBinder(BindUiLifeCycle.java:108) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.access$000(BindUiLifeCycle.java:55) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle$2.onEvent(BindUiLifeCycle.java:99) ~[zkbind-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3165) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3113) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3077) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1846) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1618) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.endUpdate(UiEngineImpl.java:1222) ~[zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zkex.ui.comet.CometServerPush.deactivate(CometServerPush.java:522) [zkex-8.0.5.jar:na]
      	at org.zkoss.zk.ui.impl.DesktopImpl.deactivateServerPush(DesktopImpl.java:1596) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.Executions.deactivate(Executions.java:1011) [zk-8.0.5.jar:8.0.5]
      	at org.zkoss.zk.ui.event.impl.DesktopEventQueue$AsyncListenerThread.run(DesktopEventQueue.java:230) [zk-8.0.5.jar:8.0.5]
      

            bobpeng bobpeng
            CJahn CJahn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 week
                1w
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 2 hours Time Not Required
                2d 2h