Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Exception starting sample application(NPE loading most recent model)
Exception starting sample application [message #1774141] Wed, 11 October 2017 01:16 Go to next message
Marcelo Ruiz is currently offline Marcelo RuizFriend
Messages: 44
Registered: April 2017
Member
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]

Report message to a moderator

Re: Exception starting sample application [message #1774317 is a reply to message #1774141] Thu, 12 October 2017 18:28 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6365
Registered: July 2009
Senior Member
Is this on the nightly or 3.0.0?
Re: Exception starting sample application [message #1774319 is a reply to message #1774317] Thu, 12 October 2017 19:10 Go to previous messageGo to next message
Marcelo Ruiz is currently offline Marcelo RuizFriend
Messages: 44
Registered: April 2017
Member
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 #1774394 is a reply to message #1774319] Fri, 13 October 2017 15:42 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6365
Registered: July 2009
Senior Member
This sounds like you have multiple versions of javax.annotation in your runtime
Previous Topic:Setting up Eclipse RCP Oxygen+ E(fx)clipse and running Tutorial2
Next Topic:Node toFront method
Goto Forum:
  


Current Time: Sat Dec 16 16:53:04 GMT 2017

Powered by FUDForum. Page generated in 0.02604 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software