Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » error while deleting
error while deleting [message #1123343] Wed, 02 October 2013 13:16 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
When deleting elements from my model, I get the following error msg. Is this a known error?

!ENTRY org.eclipse.ui 4 0 2013-10-02 15:13:51.055
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4397)
	at org.eclipse.swt.SWT.error(SWT.java:4312)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.NullPointerException
	at org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.refresh(TabbedPropertySheetPage.java:761)
	at pld.presentation.PldEditor$5$1.run(PldEditor.java:814)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 24 more
Re: error while deleting [message #1123395 is a reply to message #1123343] Wed, 02 October 2013 14:15 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Phil,

What's the code in
pld.presentation.PldEditor$5$1.run(PldEditor.java:814) doing?


On 02/10/2013 3:16 PM, Phil H wrote:
> When deleting elements from my model, I get the following error msg.
> Is this a known error?
>
>
> !ENTRY org.eclipse.ui 4 0 2013-10-02 15:13:51.055
> !MESSAGE Unhandled event loop exception
> !STACK 0
> org.eclipse.swt.SWTException: Failed to execute runnable
> (java.lang.NullPointerException)
> at org.eclipse.swt.SWT.error(SWT.java:4397)
> at org.eclipse.swt.SWT.error(SWT.java:4312)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
> at
> org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
> at
> org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
> 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage.refresh(TabbedPropertySheetPage.java:761)
> at pld.presentation.PldEditor$5$1.run(PldEditor.java:814)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> at
> org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
> ... 24 more
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: error while deleting [message #1127324 is a reply to message #1123395] Sun, 06 October 2013 14:33 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi Ed,

you mean Codeline 814?

	if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
814		propertySheetPage.refresh();
	}
Re: error while deleting [message #1127943 is a reply to message #1127324] Mon, 07 October 2013 07:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Phil,

So so that's well guarded against null and disposed widgets and looks
like what EMF would generated but the generated editor doesn't used a
tabbed property sheet, so you'll need to look at what's going on in that
code.

On 06/10/2013 4:33 PM, Phil H wrote:
> Hi Ed,
>
> you mean Codeline 814?
>
>
> if (propertySheetPage != null &&
> !propertySheetPage.getControl().isDisposed()) {
> 814 propertySheetPage.refresh();
> }
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: error while deleting [message #1128192 is a reply to message #1127943] Mon, 07 October 2013 12:40 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Hi Ed,

I used the debugger and only while deleting, it runs into the catch block in the runAsyncMessages of Sychronizer class:

boolean runAsyncMessages (boolean all) {
	boolean run = false;
	do {
		RunnableLock lock = removeFirst ();
		if (lock == null) return run;
		run = true;
		synchronized (lock) {
			syncThread = lock.thread;
			try {
				lock.run ();
			} catch (Throwable t) {
				lock.throwable = t;
				SWT.error (SWT.ERROR_FAILED_EXEC, t);
			} finally {
				syncThread = null;
				lock.notifyAll ();
			}
		}
	} while (all);
	return run;
}


This gave me the error msg, but I've not that much knowledge about the background technique to avoid this error msg and deleting elements still works, so I won't investigte further..
Re: error while deleting [message #1128199 is a reply to message #1128192] Mon, 07 October 2013 12:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Phil,

So that should let you see a stack trace and probably something is
logging it and that should let you see the cause and fix it.


On 07/10/2013 2:40 PM, Phil H wrote:
> Hi Ed,
>
> I used the debugger and only while deleting, it runs into the catch
> block in the runAsyncMessages of Sychronizer class:
>
>
> boolean runAsyncMessages (boolean all) {
> boolean run = false;
> do {
> RunnableLock lock = removeFirst ();
> if (lock == null) return run;
> run = true;
> synchronized (lock) {
> syncThread = lock.thread;
> try {
> lock.run ();
> } catch (Throwable t) {
> lock.throwable = t;
> SWT.error (SWT.ERROR_FAILED_EXEC, t);
> } finally {
> syncThread = null;
> lock.notifyAll ();
> }
> }
> } while (all);
> return run;
> }
>
>
> This gave me the error msg, but I've not that much knowledge about the
> background technique to avoid this error msg and deleting elements
> still works, so I won't investigte further..


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: error while deleting [message #1128346 is a reply to message #1128199] Mon, 07 October 2013 15:44 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Unfortunately I'm only able to get the stack trace I posted above, which don't help me much...
Re: error while deleting [message #1128963 is a reply to message #1128346] Tue, 08 October 2013 06:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Phil,

You have "t" at that point, so you can see what the exception is, and in
particular what type it is, so you can set an exception breakpoint for
that and see the next time exactly where and why it's being thrown.
Also, it appears that SWT.error wraps and throw an exception so there
must be some further processing of that error which you can follow with
the debugger.


On 07/10/2013 5:44 PM, Phil H wrote:
> Unfortunately I'm only able to get the stack trace I posted above,
> which don't help me much...


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: error while deleting [message #1130307 is a reply to message #1128963] Wed, 09 October 2013 12:21 Go to previous messageGo to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
Thx Ed for your hints. It's an NPE and setting the exception breakpoint gave me this:

index.php/fa/16431/0/

Regarding tracking the further processing of the error; it goes next to PartRenderingEgine.java to the method Object run(final MApplicationElement uiRoot, final IEclipseContext runContext), where it enter the catch(Exception ex) statement and afterwards stay at the while loop.

while (((testShell != null && !testShell.isDisposed()) || (theApp != null && someAreVisible(theApp.getChildren()))) && !display.isDisposed()) {
	try {
	   if (!display.readAndDispatch()) {
		runContext.processWaiting();
		if (spinOnce)
			return;
		advisor.eventLoopIdle(display);
	}
	} catch (ThreadDeath th) {
		throw th;
	} catch (Exception ex) {
		handle(ex, advisor);
	} catch (Error err) {
	        handle(err, advisor);
	}
}


So, it's hard for me to see any reasons for the NPE..especially while deleting works at all..

Cheers,
Phil
  • Attachment: npe.JPG
    (Size: 89.82KB, Downloaded 1718 times)
Re: error while deleting [message #1130333 is a reply to message #1130307] Wed, 09 October 2013 12:51 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Phil,

It doesn't look like the exception you show in the image is really the
one from TabbedPropertySheetPage from previous stack traces you show. I
assume you have looked at the error log because I imagine the exception
you were trying to track down originally is being looked with a full
stack trace. Have you looked closely at the source code for
TabbedPropertySheetPage to see where the error there is?


On 09/10/2013 2:21 PM, Phil H wrote:
> Thx Ed for your hints. It's an NPE and setting the exception breakpoint gave me this:
>
>
>
> Regarding tracking the further processing of the error; it goes next to PartRenderingEgine.java to the method Object run(final MApplicationElement uiRoot, final IEclipseContext runContext), where it enter the catch(Exception ex) statement and afterwards stay at the while loop.
>
>
> while (((testShell != null && !testShell.isDisposed()) || (theApp != null && someAreVisible(theApp.getChildren()))) && !display.isDisposed()) {
> try {
> if (!display.readAndDispatch()) {
> runContext.processWaiting();
> if (spinOnce)
> return;
> advisor.eventLoopIdle(display);
> }
> } catch (ThreadDeath th) {
> throw th;
> } catch (Exception ex) {
> handle(ex, advisor);
> } catch (Error err) {
> handle(err, advisor);
> }
> }
>
>
> So, it's hard for me to see any reasons for the NPE..especially while deleting works at all..
>
> Cheers,
> Phil


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:GMF Diagram performance
Next Topic:Re: [CDO] Code Review for a faster Horizontal Mapping
Goto Forum:
  


Current Time: Thu Apr 18 05:08:46 GMT 2024

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

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

Back to the top