3

I get the following exception and even can't understand at what place it appears. What can it mean?

Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at com.sun.javafx.text.PrismTextLayout.addTextRun(PrismTextLayout.java:755)
    at com.sun.javafx.text.GlyphLayout.addTextRun(GlyphLayout.java:140)
    at com.sun.javafx.text.GlyphLayout.breakRuns(GlyphLayout.java:210)
    at com.sun.javafx.text.PrismTextLayout.buildRuns(PrismTextLayout.java:770)
    at com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1021)
    at com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:223)
    at com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:246)
    at javafx.scene.text.Text.getLogicalBounds(Text.java:358)
    at javafx.scene.text.Text.impl_computeGeomBounds(Text.java:1168)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1588)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1527)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.computeLocalBounds(Node.java:3572)
    at javafx.scene.Node.updateLocalBounds(Node.java:3602)
    at javafx.scene.Node.getLocalBounds(Node.java:3463)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1588)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1527)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Parent.getChildTransformedBounds(Parent.java:1724)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1516)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.impl_intersectsBounds(Node.java:4992)
    at javafx.scene.layout.Region.impl_pickNodeLocal(Region.java:2931)
    at javafx.scene.Node.impl_pickNode(Node.java:4891)
    at javafx.scene.Scene$MouseHandler.pickNode(Scene.java:3899)
    at javafx.scene.Scene$MouseHandler.access$1600(Scene.java:3485)
    at javafx.scene.Scene.pick(Scene.java:1942)
    at javafx.scene.Scene.access$6700(Scene.java:159)
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3711)
    at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485)
    at javafx.scene.Scene$MouseHandler$1.run(Scene.java:3521)
    at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
    at com.sun.javafx.application.PlatformImpl$$Lambda$59/1182424050.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
    at com.sun.javafx.application.PlatformImpl$$Lambda$58/1283229537.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$50(GtkApplication.java:139)
    at com.sun.glass.ui.gtk.GtkApplication$$Lambda$47/1609034571.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:418)
    at java.util.ArrayList.get(ArrayList.java:431)
    at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
    at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:306)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1583)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1527)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Node.updateBounds(Node.java:538)
    at javafx.scene.Parent.updateBounds(Parent.java:1711)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2404)
    at com.sun.javafx.tk.Toolkit.lambda$runPulse$31(Toolkit.java:348)
    at com.sun.javafx.tk.Toolkit$$Lambda$167/1784277725.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:347)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:374)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$405(QuantumToolkit.java:319)
    at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$51/396808120.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$50(GtkApplication.java:139)
    at com.sun.glass.ui.gtk.GtkApplication$$Lambda$47/1609034571.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:418)
    at java.util.ArrayList.get(ArrayList.java:431)
    at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
    at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:306)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1583)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1527)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Node.updateBounds(Node.java:538)
    at javafx.scene.Parent.updateBounds(Parent.java:1711)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2404)
    at com.sun.javafx.tk.Toolkit.lambda$runPulse$31(Toolkit.java:348)
    at com.sun.javafx.tk.Toolkit$$Lambda$167/1784277725.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:347)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:374)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$405(QuantumToolkit.java:319)
    at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$51/396808120.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$50(GtkApplication.java:139)
    at com.sun.glass.ui.gtk.GtkApplication$$Lambda$47/1609034571.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:418)
    at java.util.ArrayList.get(ArrayList.java:431)
    at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
    at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:306)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1583)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1527)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Node.updateBounds(Node.java:538)
    at javafx.scene.Parent.updateBounds(Parent.java:1711)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2404)
    at com.sun.javafx.tk.Toolkit.lambda$runPulse$31(Toolkit.java:348)
    at com.sun.javafx.tk.Toolkit$$Lambda$167/1784277725.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:347)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:374)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$405(QuantumToolkit.java:319)
    at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$51/396808120.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$50(GtkApplication.java:139)
    at com.sun.glass.ui.gtk.GtkApplication$$Lambda$47/1609034571.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:418)
    at java.util.ArrayList.get(ArrayList.java:431)
    at com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
    at com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:306)
    at javafx.scene.Parent.updateCachedBounds(Parent.java:1583)
    at javafx.scene.Parent.recomputeBounds(Parent.java:1527)
    at javafx.scene.Parent.impl_computeGeomBounds(Parent.java:1380)
    at javafx.scene.layout.Region.impl_computeGeomBounds(Region.java:3078)
    at javafx.scene.Node.updateGeomBounds(Node.java:3556)
    at javafx.scene.Node.getGeomBounds(Node.java:3509)
    at javafx.scene.Node.getLocalBounds(Node.java:3457)
    at javafx.scene.Node.updateTxBounds(Node.java:3620)
    at javafx.scene.Node.getTransformedBounds(Node.java:3403)
    at javafx.scene.Node.updateBounds(Node.java:538)
    at javafx.scene.Parent.updateBounds(Parent.java:1711)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Parent.updateBounds(Parent.java:1709)
    at javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2404)
    at com.sun.javafx.tk.Toolkit.lambda$runPulse$31(Toolkit.java:348)
    at com.sun.javafx.tk.Toolkit$$Lambda$167/1784277725.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:347)
    at com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:374)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:510)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:490)
    at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$405(QuantumToolkit.java:319)
    at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$51/396808120.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$50(GtkApplication.java:139)
    at com.sun.glass.ui.gtk.GtkApplication$$Lambda$47/1609034571.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
  • @Jens You are quite wrong. I know what is nullpointerexception. The question is about javafx, becuase the problem arises somewhere in standard java library, not in my code as you can see from log. So please, remove your "duplicate" – Pavel_K Aug 04 '16 at 07:24
  • have any code to post sir – Elltz Aug 04 '16 at 07:31
  • @Elltz I have about 30 classes which are linked with javafx. Which one? I do say - I even can't understand what look at. – Pavel_K Aug 04 '16 at 07:33
  • 3
    Seems like you managed to get a exception during the layouting, so every pulse a exception happens. Please create a [mcve] and post it. Otherwise it's hard to to find the issue... – fabian Aug 04 '16 at 07:33
  • The first exception is different to the others, and looks like it occurs on a `Text` node somewhere. If you explicitly have `Text` nodes, I would start there. As @fabian notes the exceptions are occurring during layout. Even if you have a large number of classes, you can presumably display subsets of the layout represented by small subsets of those classes independently of each other, so you can narrow down the cause of the exception. – James_D Aug 04 '16 at 11:13
  • see https://stackoverflow.com/a/45679685/1497139 for more links – Wolfgang Fahl Aug 14 '17 at 17:26
  • If you use periodic background task, use this for JavaFx: https://stackoverflow.com/questions/9966136/javafx-periodic-background-task – mzhehalo Sep 01 '22 at 12:09

1 Answers1

5

This happened to me too, and I just wanted to write how I solved it. The answer is: I was editing the GUI from a non-JavaFX thread. I was absolutely convinced I wasn't but I was. Check your code if you have this issue, and use Platform.runLater() to run GUI changes in the correct JavaFX thread.

user3804769
  • 469
  • 1
  • 8
  • 19