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

NPE in StyleManager.findMatchingStyles(..) when creating UI in background thread

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 8u40
    • javafx
    • Mac OS X Yosemite 10.10

      java version "1.8.0_40"
      Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
      Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

      The NPE happens when I create the Node structure in a background thread. The nodes are not connected to a Scene (AFAICT). The exact stack trace varies a little bit but the NPE is always in the exact same place.

      The code is way too complex to post unfortunately. I just thought I'd file the bug since it might be something simple that you can spot right away.

      Marked a blocker since I cannot create UI in a background thread in any way with this bug.

      Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
      at com.sun.javafx.css.StyleManager.findMatchingStyles(StyleManager.java:1759)
      at javafx.scene.CssStyleHelper.createStyleHelper(CssStyleHelper.java:111)
      at javafx.scene.Node.reapplyCss(Node.java:8962)
      at javafx.scene.Node.reapplyCss(Node.java:8991)
      at javafx.scene.Node.impl_reapplyCSS(Node.java:8925)
      at javafx.scene.Node.invalidatedScenes(Node.java:833)
      at javafx.scene.Node.setScenes(Node.java:898)
      at javafx.scene.Parent$1.onChanged(Parent.java:269)
      at com.sun.javafx.collections.TrackableObservableList.lambda$new$19(TrackableObservableList.java:45)
      at com.sun.javafx.collections.TrackableObservableList$$Lambda$60/144432538.onChanged(Unknown Source)
      at com.sun.javafx.collections.ListListenerHelper$Generic.fireValueChangedEvent(ListListenerHelper.java:329)
      at com.sun.javafx.collections.ListListenerHelper.fireValueChangedEvent(ListListenerHelper.java:73)
      at javafx.collections.ObservableListBase.fireChange(ObservableListBase.java:233)
      at javafx.collections.ListChangeBuilder.commit(ListChangeBuilder.java:482)
      at javafx.collections.ListChangeBuilder.endChange(ListChangeBuilder.java:541)
      at javafx.collections.ObservableListBase.endChange(ObservableListBase.java:205)
      at javafx.collections.ModifiableObservableListBase.addAll(ModifiableObservableListBase.java:102)
      at com.sun.javafx.collections.VetoableListDecorator.addAll(VetoableListDecorator.java:237)
      at com.sun.javafx.collections.VetoableListDecorator.addAll(VetoableListDecorator.java:103)
      at com.sun.javafx.scene.control.skin.ScrollBarSkin.initialize(ScrollBarSkin.java:331)
      at com.sun.javafx.scene.control.skin.ScrollBarSkin.<init>(ScrollBarSkin.java:75)
      at javafx.scene.control.ScrollBar.createDefaultSkin(ScrollBar.java:363)
      at javafx.scene.control.Control.impl_processCSS(Control.java:859)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1269)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1269)
      at javafx.scene.control.Control.impl_processCSS(Control.java:862)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1269)
      at javafx.scene.control.Control.impl_processCSS(Control.java:862)
      at javafx.scene.Parent.impl_processCSS(Parent.java:1269)
      at javafx.scene.Node.processCSS(Node.java:9035)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Node.processCSS(Node.java:9028)
      at javafx.scene.Scene.doCSSPass(Scene.java:545)
      at javafx.scene.Scene.access$3600(Scene.java:159)
      at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2392)
      at com.sun.javafx.tk.Toolkit.lambda$runPulse$30(Toolkit.java:314)
      at com.sun.javafx.tk.Toolkit$$Lambda$345/1459456185.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:525)
      at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:505)
      at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$400(QuantumToolkit.java:334)
      at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$49/1976275580.run(Unknown Source)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

            jgiles Jonathan Giles
            mgrev Mikael Grev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: