Exception starting sample application [message #1774141] |
Wed, 11 October 2017 01:16  |
Eclipse User |
|
|
|
Hi,
My application does not start due to a NullPointerException. I though I broke things when trying to use the Reactor 3 library.
To be sure I did something wrong, I created a new application using the wizard and following the steps of Tutorial 4, where I edited the Application.e4xmi and added a trimmed window (defining its size and position on the screen) and added also an empty part.
To my surprise, I still get the same exception and the application does not start:
!ENTRY org.eclipse.equinox.app 4 0 2017-10-10 21:05:35.210
!MESSAGE Exception in Application start method
!STACK 0
java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at org.eclipse.fx.ui.workbench.base.internal.EFX_ResourceHandler.loadMostRecentModel(EFX_ResourceHandler.java:176)
at org.eclipse.fx.ui.workbench.base.AbstractE4Application.loadApplicationModel(AbstractE4Application.java:422)
at org.eclipse.fx.ui.workbench.base.AbstractE4Application.createE4Workbench(AbstractE4Application.java:267)
at org.eclipse.fx.ui.workbench.fx.E4Application.initE4Workbench(E4Application.java:358)
at org.eclipse.fx.ui.workbench.fx.E4Application$1.run(E4Application.java:215)
at org.eclipse.fx.ui.workbench.fx.E4Application.jfxStart(E4Application.java:253)
at org.eclipse.fx.ui.workbench.fx.DefaultJFXApp.start(DefaultJFXApp.java:57)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
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$49(GtkApplication.java:139)
... 1 more
Any idea of what might be the cause for this? I thought this problem was caused by having Java 9 running on my system, but I uninstalled it and reinstalled Java 8 and it is still there.
Maybe a good addition to the sample app, will be to make it at least display an empty window without requiring the developer to touch anything. Once that window is displayed, proving the configuration is correct, development could start on a sound base.
Thanks!
[Updated on: Thu, 12 October 2017 16:23] by Moderator Report message to a moderator
|
|
|
|
Re: Exception starting sample application [message #1774319 is a reply to message #1774317] |
Thu, 12 October 2017 19:10   |
Eclipse User |
|
|
|
Hi Tom,
Thanks for your answer. It is happening in both.
This is what I found out:
EFX_ResourceHandler has a private variable:
private ResourceSetImpl resourceSetImpl;
that should be initialized in:
@PostConstruct
void init() {
this.resourceSetImpl = new ResourceSetImpl();
....
}
but the method seems to be never called (I set a debug breakpoint there but it is never reached). So the execution of:
private Resource getResource(URI uri) throws Exception {
Resource resource;
if (this.saveAndRestore) {
resource = this.resourceSetImpl.getResource(uri, true); //NPE HERE
} else {
// Workaround for java.lang.IllegalStateException: No instance data can be specified
// thrown by org.eclipse.core.internal.runtime.DataArea.assertLocationInitialized
// The DataArea.assertLocationInitialized is called by ResourceSetImpl.getResource(URI,
// boolean)
resource = this.resourceSetImpl.createResource(uri);
resource.load(new URL(uri.toString()).openStream(), this.resourceSetImpl.getLoadOptions());
}
return resource;
}
throws the NullPointerException.
I hope that information can give you a better hint of what might be going on.
Thanks!
|
|
|
|
Re: Exception starting sample application [message #1795361 is a reply to message #1774394] |
Thu, 20 September 2018 22:46   |
Eclipse User |
|
|
|
I'm having the same problem (@PostConstruct not executed).
I suspect your diagnosis in the previous post applies, but I just don't know how to fix it.
I'm running Eclipse IDE Version: 2018-09 (4.9.0), fx runtime 3.4.0, and java version "1.8.0_171."
Would you please tell me how.
Thank-you.
|
|
|
|
Re: Exception starting sample application [message #1795690 is a reply to message #1795418] |
Wed, 26 September 2018 23:26   |
Eclipse User |
|
|
|
Initially I was running a POJO, but I get the same result when it is run from a product "Launch an ecipse application." I don't see in either run configurations (including "show command line") any references to javax.annotation.
The eclipse platform plug-ins tab has
javax.annotation bundle 1.2.0v201602091430
How do I determine what bundles are loaded when launching? How can I add it for both cases?
|
|
|
|
Re: Exception starting sample application [message #1796085 is a reply to message #1795977] |
Thu, 04 October 2018 23:24   |
Eclipse User |
|
|
|
Thanks Thomas. Here's what I get:
osgi> inspect bundle capability javax.annotation
javax.annotation_1.2.0.v201602091430 [5] is required by:
--------------------------------------------------------
Nothing
osgi> inspect bundle requirement javax.annotation
javax.annotation_1.2.0.v201602091430 [5] requires bundles:
----------------------------------------------------------
osgi.wiring.bundle; bundle-version:Version="2.6.0.v201404270220"; osgi.wiring.bundle="org.apache.commons.lang"
osgi>
|
|
|
|
Powered by
FUDForum. Page generated in 0.30345 seconds