JavaFx-线程中无休止的异常;JavaFX应用程序线程;java.lang.NullPointerException

JavaFx-线程中无休止的异常;JavaFX应用程序线程;java.lang.NullPointerException,java,javafx,Java,Javafx,我得到以下异常,甚至无法理解它出现在什么地方。这意味着什么 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

我得到以下异常,甚至无法理解它出现在什么地方。这意味着什么

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

这也发生在我身上,我只想写下我是如何解决它的。答案是:我是从非JavaFX线程编辑GUI的。我完全相信我不是,但我是。如果存在此问题,请检查您的代码,并使用
Platform.runLater()
在正确的JavaFX线程中运行GUI更改。

@Jens您完全错了。我知道什么是nullpointerexception。问题是关于javafx的,因为问题出现在标准java库的某个地方,而不是我的代码中,正如您从日志中看到的那样。所以,请删除您的“副本”有任何代码发布sir@Elltz我有大约30个与javafx链接的类。哪一个?我真的说-我甚至不明白你在看什么。看起来你在布局过程中遇到了一个异常,所以每一个脉冲都会发生一个异常。请创建一个链接并发布它。否则很难找到问题……第一个异常与其他异常不同,看起来它发生在某个
Text
节点上。如果显式地有
Text
节点,我将从那里开始。正如@fabian所指出的,在布局过程中会出现异常。即使您有大量的类,您也可以独立地显示由这些类的小子集表示的布局子集,以便缩小异常的原因。