JavaFX wirft zufällig Exceptions

Diskutiere JavaFX wirft zufällig Exceptions im AWT, Swing, JavaFX & SWT Bereich.
F

FawKes100

Guten Tag, habe ein kleines Problem mit meinem JavaFX Projekt. Und zwar wird manchmal ne NullPointerException geworfen, wenn ich auf einen Button klicke, manchmal aber auch nicht. Allerdings liegt der Ursprung dieser Exceptions nicht in meinen Klassen. Nach dem Stacktrace sind nur die JavaFX Klassen für diese Exception verantwortlich - heißt also ich kann nicht wirklich was tun um diese Exceptions abzufangen bzw zu vermeiden.
Der fehler tritt bei folgender onAction Methode auf:

Java:
public void onConnect(ActionEvent event) {
    if(client == null) {
        client = new Client(hostField.getText(), Integer.parseInt(portField.getText()), this);
    }
    client.login(deviceField.getText(), passwortField.getText());
}
Dabei erhalte ich folgenden Stacktrace:
"C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.3\jbr\bin\java.exe" --add-modules javafx.base,javafx.graphics --add-reads javafx.base=ALL-UNNAMED --add-reads javafx.graphics=ALL-UNNAMED "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.3\lib\idea_rt.jar=56054:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.3\bin" -Dfile.encoding=UTF-8 -p C:\Java\javafx-sdk-11.0.2\lib\javafx.base.jar;C:\Java\javafx-sdk-11.0.2\lib\javafx.graphics.jar;C:\Users\boeck\Documents\Programmier-Projekte\Java\DataSync\Client\out\production\Client;C:\Java\javafx-sdk-11.0.2\lib\javafx-swt.jar;C:\Java\javafx-sdk-11.0.2\lib\javafx.web.jar;C:\Java\javafx-sdk-11.0.2\lib\javafx.fxml.jar;C:\Java\javafx-sdk-11.0.2\lib\javafx.media.jar;C:\Java\javafx-sdk-11.0.2\lib\javafx.swing.jar;C:\Java\javafx-sdk-11.0.2\lib\javafx.controls.jar;C:\Users\boeck\Documents\Programmier-Projekte\Libarys\commons-net-3.6\commons-net-3.6.jar;C:\Users\boeck\Documents\Programmier-Projekte\Java\Libary\jsch-0.1.55.jar -m Client/core.sample.Main
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1064)
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:222)
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:245)
at javafx.graphics/javafx.scene.text.Text.getLogicalBounds(Text.java:430)
at javafx.graphics/javafx.scene.text.Text.doComputeGeomBounds(Text.java:1173)
at javafx.graphics/javafx.scene.text.Text.access$300(Text.java:127)
at javafx.graphics/javafx.scene.text.Text$1.doComputeGeomBounds(Text.java:148)
at javafx.graphics/com.sun.javafx.scene.shape.TextHelper.computeGeomBoundsImpl(TextHelper.java:90)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Node.updateBounds(Node.java:766)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2522)
at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:410)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:409)
at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:436)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:524)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:504)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:497)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
at java.base/java.lang.Thread.run(Thread.java:834)

Betätige ich nun noch einen weiteren Button, der dafür sorgen soll, dass der Client, der bei connect erstellt wird etwas tun soll, erhalte ich folgenden Stacktrace:

Java:
 public void onStartAutoSync(ActionEvent event) {
        System.out.println("Start Autosync!");
        if(!autosyncButton.getText().equalsIgnoreCase("Stop AutoSync")) {
            autosyncButton.setText("Stop AutoSync");
            client.activateDataSync(DataSyncMode.AutoSync);
        }
}
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.shape(PrismTextLayout.java:870)
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1065)
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.ensureLayout(PrismTextLayout.java:222)
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.getBounds(PrismTextLayout.java:245)
at javafx.graphics/javafx.scene.text.Text.getLogicalBounds(Text.java:430)
at javafx.graphics/javafx.scene.text.Text.doComputeGeomBounds(Text.java:1173)
at javafx.graphics/javafx.scene.text.Text.access$300(Text.java:127)
at javafx.graphics/javafx.scene.text.Text$1.doComputeGeomBounds(Text.java:148)
at javafx.graphics/com.sun.javafx.scene.shape.TextHelper.computeGeomBoundsImpl(TextHelper.java:90)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.updateCachedBounds(Parent.java:1713)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1652)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.computeLocalBounds(Node.java:3849)
at javafx.graphics/javafx.scene.Node.updateLocalBounds(Node.java:3879)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3749)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.updateCachedBounds(Parent.java:1713)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1652)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.computeLocalBounds(Node.java:3849)
at javafx.graphics/javafx.scene.Node.updateLocalBounds(Node.java:3879)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3749)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.updateCachedBounds(Parent.java:1713)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1652)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1641)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.computeLocalBounds(Node.java:3849)
at javafx.graphics/javafx.scene.Node.updateLocalBounds(Node.java:3879)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3749)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Parent.getChildTransformedBounds(Parent.java:1852)
at javafx.graphics/javafx.scene.Parent.updateCachedBounds(Parent.java:1713)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1652)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.intersectsBounds(Node.java:5268)
at javafx.graphics/javafx.scene.Node$1.intersectsBounds(Node.java:548)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.intersectsBounds(NodeHelper.java:276)
at javafx.graphics/javafx.scene.layout.Region.doPickNodeLocal(Region.java:3160)
at javafx.graphics/javafx.scene.layout.Region.access$600(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doPickNodeLocal(Region.java:186)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.pickNodeLocalImpl(RegionHelper.java:104)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.pickNodeLocal(NodeHelper.java:130)
at javafx.graphics/javafx.scene.Node.pickNode(Node.java:5178)
at javafx.graphics/javafx.scene.Scene$MouseHandler.pickNode(Scene.java:4018)
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1400(Scene.java:3604)
at javafx.graphics/javafx.scene.Scene.pick(Scene.java:2054)
at javafx.graphics/javafx.scene.Scene.access$6900(Scene.java:173)
at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3918)
at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3604)
at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1874)
at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2613)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:395)
at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
at java.base/java.lang.Thread.run(Thread.java:834)
Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 3
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at javafx.base/com.sun.javafx.collections.ObservableListWrapper.get(ObservableListWrapper.java:89)
at javafx.base/com.sun.javafx.collections.VetoableListDecorator.get(VetoableListDecorator.java:306)
at javafx.graphics/javafx.scene.Parent.updateCachedBounds(Parent.java:1708)
at javafx.graphics/javafx.scene.Parent.recomputeBounds(Parent.java:1652)
at javafx.graphics/javafx.scene.Parent.doComputeGeomBounds(Parent.java:1505)
at javafx.graphics/javafx.scene.Parent.access$200(Parent.java:81)
at javafx.graphics/javafx.scene.Parent$1.doComputeGeomBounds(Parent.java:117)
at javafx.graphics/com.sun.javafx.scene.ParentHelper.computeGeomBoundsImpl(ParentHelper.java:86)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBoundsImpl(RegionHelper.java:78)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.superComputeGeomBounds(RegionHelper.java:62)
at javafx.graphics/javafx.scene.layout.Region.doComputeGeomBounds(Region.java:3291)
at javafx.graphics/javafx.scene.layout.Region.access$300(Region.java:149)
at javafx.graphics/javafx.scene.layout.Region$1.doComputeGeomBounds(Region.java:170)
at javafx.graphics/com.sun.javafx.scene.layout.RegionHelper.computeGeomBoundsImpl(RegionHelper.java:89)
at javafx.graphics/com.sun.javafx.scene.NodeHelper.computeGeomBounds(NodeHelper.java:117)
at javafx.graphics/javafx.scene.Node.updateGeomBounds(Node.java:3833)
at javafx.graphics/javafx.scene.Node.getGeomBounds(Node.java:3795)
at javafx.graphics/javafx.scene.Node.getLocalBounds(Node.java:3743)
at javafx.graphics/javafx.scene.Node.updateTxBounds(Node.java:3897)
at javafx.graphics/javafx.scene.Node.getTransformedBounds(Node.java:3689)
at javafx.graphics/javafx.scene.Node.updateBounds(Node.java:766)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1839)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Parent.updateBounds(Parent.java:1837)
at javafx.graphics/javafx.scene.Scene$ScenePulseListener.pulse(Scene.java:2522)
at javafx.graphics/com.sun.javafx.tk.Toolkit.lambda$runPulse$2(Toolkit.java:410)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.tk.Toolkit.runPulse(Toolkit.java:409)
at javafx.graphics/com.sun.javafx.tk.Toolkit.firePulse(Toolkit.java:436)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:524)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:504)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:497)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
at java.base/java.lang.Thread.run(Thread.java:834)

Vielleicht hat hier jemand eine Idee was der Ursprung dieser Exceptions ist und wie ich sie umgehen kann? Denn mit diesen Exceptions ist ein vernünftiges Arbeiten mit der Anwendung nicht möglich.
Die Exceptions treten aber auch nicht immer auf, nur manchmal..

Was mich halt irritiert, ist dass die Exceptions nicht verursacht zu sein scheinen von meinem Code, sondern von JavaFX internen Code...
 
VfL_Freak

VfL_Freak

Moin,

ohne Code kann man nicht viel mehr sagen als: irgendwas wird NULL sein !!

Der erste Fehler tritt genau hier auf:
Java:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1064)
der zweite dann genau hier:
Java:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.shape(PrismTextLayout.java:870)
VG Klaus
 
F

FawKes100

Vermutlich hantierst Du mit Threads rum
Jop, arbeite mit Threads


Bist du im UI-Thread, wenn du UI-Sachen aufrufst?
Ja. Wenn ich mal über einen anderen Thread Methoden aus dem Controller aurufe benutze ich die Platform.runLater Methode


Moin,

ohne Code kann man nicht viel mehr sagen als: irgendwas wird NULL sein !!

Der erste Fehler tritt genau hier auf:
Java:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.layout(PrismTextLayout.java:1064)
der zweite dann genau hier:
Java:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at javafx.graphics/com.sun.javafx.text.PrismTextLayout.shape(PrismTextLayout.java:870)
VG Klaus
Mir ist klar, wann die NullpointerException auftritt. Weshalb ich keinen Code dazugesendet habe, sollte eigentlich klar sein:
Der Fehler tritt nur in den Java-FX Klassen auf, wenn du dir den Stacktrace ansiehst. Keine einzige Zeile, die im Stacktrace steht wurde von mir geschrieben oder sonst wie editiert.
Ich vermute dass das ein Bug bezüglich JavaFX und mehreren Threads sein wird, denn ich habe nun das Projekt einmal überarbeitet und den ganzen Code aufgeräumt und teilweise auch umgeschrieben und nu läuft alles.
 
dzim

dzim

Schon mal geschaut, ob im TextField "portField" wirklich parsbarer (via Integer#parseInt) Text steht? Ich würde so was nie ohne try-catch probieren!
Aber wie @VfL_Freak schon sagt: Ohne Code kann man kaum helfen. Ich denke auch eher - auch wenn der StackTrace das nicht nahelegt - dass der Fehler in deinem Code liegt. Ich will damit nicht sagen, dass der FX-Code frei von Fehlern wäre - nie und nimmer - aber in dem Fall habe ich einfach schon zu viel abstrusen Kram mit TextFields gemacht und mir ist so was noch nie untergekommen.
 
Thema: 

JavaFX wirft zufällig Exceptions

Passende Stellenanzeigen aus deiner Region:
Anzeige

Neue Themen

Anzeige

Anzeige
Oben