Skip to content

NullpointerException beim Starten der Anwendung bei fehlender onAction-Methode #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spaxx86 opened this issue Jul 17, 2014 · 1 comment

Comments

@spaxx86
Copy link

spaxx86 commented Jul 17, 2014

Ich habe meine fxml-Datei um einen Button erweitert und diesem eine onAction Methode in der FXML-Datei hinzugefügt. Wenn ich diese vergesse zu implementieren in meiner View-Klasse, dann startet die Anwendung nicht mehr und fogende Fehlermeldung erscheint:

Exception in thread "main" 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
at de.saxsys.javafx.App.start(App.java:41)
at de.saxsys.jfx.mvvm.cdi.MvvmfxCdiApplication.listenToStartup(MvvmfxCdiApplication.java:60)
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 org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
at de.saxsys.jfx.mvvm.cdi.internal.WeldStartupHelper.start(WeldStartupHelper.java:61)
at com.sun.javafx.application.LauncherImpl$8.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

Wird die onAction-Methode implementiert startet die Anwendung wie gewohnt.

@manuel-mauky
Copy link
Collaborator

Dass die Anwendung nicht mehr startet ist das normale Verhalten von JavaFX und FXML.
Das ist auch so wenn man kein MvvmFX verwendet.

Tatsächlich wäre aber eine bessere Fehlermeldung hilfreich. Der Original-FXMLLoader wirft eine brauchbare Fehlermeldung, die wir weiterreichen könnten.

manuel-mauky added a commit that referenced this issue Jul 22, 2014
…ntime exception is thrown that contains the root cause. This way the development and debugging of applications should be easier.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants