Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8096714

NPE in Scene.synchronizeSceneProperties, at impl_peer.setRoot(getRoot().impl_getPeer())

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u31
    • javafx
    • None

      I'm receiving a NullPointerException with JDK 8u31 with the following stacktrace:

      Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
             at javafx.scene.Scene$ScenePulseListener.synchronizeSceneProperties(Scene.java:2296)
             at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2396)
             at com.sun.javafx.tk.Toolkit.lambda$runPulse$28(Toolkit.java:314)
             at com.sun.javafx.tk.Toolkit$$Lambda$300/22160544.run(Unknown Source)
             at java.security.AccessController.doPrivileged(Native Method)
             at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:313)
             at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:340)
             at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:451)
             at com.sun.javafx.tk.quantum.PaintCollector.liveRepaintRenderJob(PaintCollector.java:320)
             at com.sun.javafx.tk.quantum.GlassViewEventHandler$ViewEventNotification.run(GlassViewEventHandler.java:761)
             at com.sun.javafx.tk.quantum.GlassViewEventHandler$ViewEventNotification.run(GlassViewEventHandler.java:722)
             at java.security.AccessController.doPrivileged(Native Method)
             at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:794)
             at com.sun.glass.ui.View.handleViewEvent(View.java:537)
             at com.sun.glass.ui.View.notifyResize(View.java:863)
             at com.sun.glass.ui.win.WinWindow._setBounds(Native Method)
             at com.sun.glass.ui.Window.setBounds(Window.java:535)
             at com.sun.javafx.tk.quantum.WindowStage.setBounds(WindowStage.java:285)
             at javafx.stage.Window$TKBoundsConfigurator.apply(Window.java:1193)
             at javafx.stage.Window$TKBoundsConfigurator.pulse(Window.java:1209)
             at com.sun.javafx.tk.Toolkit.lambda$runPulse$28(Toolkit.java:314)
             at com.sun.javafx.tk.Toolkit$$Lambda$300/22160544.run(Unknown Source)
             at java.security.AccessController.doPrivileged(Native Method)
             at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:313)
             at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:337)
             at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:451)
             at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:431)
             at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$363(QuantumToolkit.java:298)
             at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$41/22933945.run(Unknown Source)
             at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
             at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
             at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
             at com.sun.glass.ui.win.WinApplication$$Lambda$37/24529870.run(Unknown Source)
             at java.lang.Thread.run(Thread.java:745)
      Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
             at javafx.scene.Scene$ScenePulseListener.synchronizeSceneProperties(Scene.java:2296)
             at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2396)
             at com.sun.javafx.tk.Toolkit.lambda$runPulse$28(Toolkit.java:314)
             at com.sun.javafx.tk.Toolkit$$Lambda$300/22160544.run(Unknown Source)
             at java.security.AccessController.doPrivileged(Native Method)
             at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:313)
             at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:340)
             at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:451)
             at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:431)
             at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$363(QuantumToolkit.java:298)
             at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$41/22933945.run(Unknown Source)
             at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
             at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
             at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
             at com.sun.glass.ui.win.WinApplication$$Lambda$37/24529870.run(Unknown Source)
             at java.lang.Thread.run(Thread.java:745)

      The line referenced is:

      2293: private void synchronizeSceneProperties() {
      2294: inSynchronizer = true;
      2295: if (isDirty(DirtyBits.ROOT_DIRTY)) {
      2296: impl_peer.setRoot(getRoot().impl_getPeer());
      2297: }

      This is happening *sometimes* when the application is started and I can't exclude that it is something goofy in my application/code. Vague, I know, sorry for that, but I can't reproduce the exception reliable. It just pops up from time to time and given it is happening on the next pulse, I can't really point out what part of my code is causing it.

      However, I am very certain that getRoot() returns an object, as the Scene I'm creating already receives a valid object as root in the constructor.

      Though, it might be related to my custom focus (com.sun.javafx.scene.traversal.)Algorithm, as I've seen this exception pop up more often when Alogrithm.select(Node, Direction, TraversalContext) returns null. The algorithm is set on the root node of the scene with:

      root.setImpl_traversalEngine(new ParentTraversalEngine(root, new MyCustomAlgorithm()));

      Do you have any ideas what this could be or how I could further debug it?

      Disclaimer: I'm aware that this is not an official/public/supported API, but until RT-25538 and/or RT-19379 are done, it's all I've got (except hooking key-events and doing everything myself, that is).

            ckyang Chien Yang (Inactive)
            rzenzjfx Robert Zenz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: