File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes setDefaultUncaughtExceptionHandler won't work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "setDefaultUncaughtExceptionHandler won Watch "setDefaultUncaughtExceptionHandler won New topic
Author

setDefaultUncaughtExceptionHandler won't work?

Wiggo Lindholm
Greenhorn

Joined: Oct 19, 2013
Posts: 1
Hey, Everything worked fine earlier today, I took a break and when I came back, it didn't work. I don't know if it might be because I changed something which screwed it up. Sadly I don't use revision or anything so I can't rewind and I have no idea what's up.

Main.java


Exception:
[Spoiler]Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException: inputStream is null.
at javafx.fxml.FXMLLoader.load(Unknown Source)
at gui.View.loadRoot(View.java:52)
at gui.View.<init>(View.java:32)
at Main.start(Main.java:58)
at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$7.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$6.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source)
at com.sun.glass.ui.win.WinApplication$4$1.run(Unknown Source)
... 1 more
Exception running application Main[/spoiler]

View.java


The thing is, when I fix the code and it doesn't throw an exception, then I click a button or something and that'll throw an exception the exception is handled just fine with the Thread.setDefaultUncaughtExceptionHandler(...);
But for some reason it doesn't work outside the ui or something and I can't figure out why. (Yes I am using JDK 8)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: setDefaultUncaughtExceptionHandler won't work?