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

getDesktop() sometimes returns NULL causing NPE

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 8.0.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      apache-tomcat-8.0.24

      Description

      Almost every day we can find in our application log these examples of the same problem

      • IMHO it is problem with lost ZK desktop after session timeout, when client tries to do some action in browser
      • for example i have a testcase:
        • I have 2 browser tabs for the same application (different pages and desktops)
        • in first tab I use a long operation action
        • in second tab I use logout action
        • the NullPointerException is thrown for the first tab since desktop is NULL

      I am not able to find solution on the internet so I am asking here.

      Examples:

      2017-08-09T10:15:49,222 [/orionweb] [{user=mrz}] ERROR org.zkoss.zul.Grid-
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.AbstractComponent.addMoved(AbstractComponent.java:483) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.setParent(AbstractComponent.java:1257) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zul.Grid$Renderer.render(Grid.java:1148) [zul-8.0.3.1.jar:?]
      	at org.zkoss.zul.Grid.doInitRenderer(Grid.java:1020) [zul-8.0.3.1.jar:?]
      	at org.zkoss.zul.Grid.onInitRender(Grid.java:977) [zul-8.0.3.1.jar:?]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
      	at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3144) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3075) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1853) [zk-8.0.3.1.jar:?]
      
      2017-08-09T10:15:50,213 [/orionweb] [{user=mrz}] ERROR org.zkoss.zk.ui.impl.UiEngineImpl-
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.AbstractComponent.getAttachedUiEngine(AbstractComponent.java:376) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1844) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1818) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.smartUpdate(AbstractComponent.java:1884) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zul.Row.setLoaded(Row.java:181) ~[zul-8.0.3.1.jar:?]
      	at org.zkoss.zul.Grid$Renderer.render(Grid.java:1152) ~[zul-8.0.3.1.jar:?]
      	at org.zkoss.zul.Grid.doInitRenderer(Grid.java:1020) ~[zul-8.0.3.1.jar:?]
      	at org.zkoss.zul.Grid.onInitRender(Grid.java:977) ~[zul-8.0.3.1.jar:?]
      
      2016-11-01T10:02:11,294 [] [{}] [http-nio-8102-exec-41] ERROR Fatal- 
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.AbstractComponent.addMoved(AbstractComponent.java:483) ~[zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.setParent(AbstractComponent.java:1257) ~[zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.insertBefore(AbstractComponent.java:1356) ~[zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.appendChild(AbstractComponent.java:1534) ~[zk-8.0.2.1.jar:?]
      	at cz.ccv.orionweb.composers.general.DashboardComposer.addDocumentButton(DashboardComposer.java:468) ~[DashboardComposer.class:?]
      	at cz.ccv.orionweb.composers.general.DashboardComposer.addDocumentButton(DashboardComposer.java:490) ~[DashboardComposer.class:?]
      	at cz.ccv.orionweb.composers.general.DashboardComposer.fillWaitingForResolved(DashboardComposer.java:221) ~[DashboardComposer.class:?]
      	at cz.ccv.orionweb.composers.general.DashboardComposer.doAfterCompose(DashboardComposer.java:105) ~[DashboardComposer.class:?]
      
      2016-11-01T10:02:11,327 [/orionweb] [{user=kraftcs}] [http-nio-8102-exec-41] ERROR org.zkoss.zk.ui.impl.UiEngineImpl- 
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2156) ~[zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1003) ~[zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:699) ~[zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1538) [zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1344) [zk-8.0.2.1.jar:?]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606) [zk-8.0.2.1.jar:8.0.2.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482) [zk-8.0.2.1.jar:8.0.2.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:490) [zk-8.0.2.1.jar:8.0.2.1]
      
      2017-05-18T09:15:38,848 [/orionweb] [{user=gstobchod}] [http-nio-8102-exec-76] ERROR org.zkoss.zk.ui.impl.UiEngineImpl- 
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.AbstractComponent.redraw(AbstractComponent.java:2156) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiVisualizer.redraw(UiVisualizer.java:1003) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiVisualizer.getResponses(UiVisualizer.java:699) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1538) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1344) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606) [zk-8.0.3.1.jar:8.0.3.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482) [zk-8.0.3.1.jar:8.0.3.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:490) [zk-8.0.3.1.jar:8.0.3.1]
      
      2017-08-07T15:53:54,576 [/orionadmin] [{user=mrz}] ERROR org.zkoss.zk.ui.impl.UiEngineImpl- Unable to generate custom error page, /WEB-INF/zk/unsecure/exception/error.zul
      java.lang.NullPointerException
      	at org.zkoss.zk.ui.AbstractComponent.addMoved(AbstractComponent.java:483) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.AbstractComponent.setPageBefore(AbstractComponent.java:432) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:142) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:925) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:895) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:777) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:841) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:797) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:740) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.createComponents(UiEngineImpl.java:1150) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:346) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:307) ~[zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.visualizeErrors(UiEngineImpl.java:1581) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.getResponses(UiEngineImpl.java:1535) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1344) [zk-8.0.3.1.jar:?]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606) [zk-8.0.3.1.jar:8.0.3.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482) [zk-8.0.3.1.jar:8.0.3.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:490) [zk-8.0.3.1.jar:8.0.3.1]
      

        Activity

        Hide
        Worsik Worsik added a comment -

        Reproduced on ZK 8.0.5

        Show
        Worsik Worsik added a comment - Reproduced on ZK 8.0.5

          People

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

            Dates

            • Created:
              Updated: