Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Tracking down the source of a NullPointerException during shutdown
Tracking down the source of a NullPointerException during shutdown [message #463761] Thu, 15 February 2007 07:19 Go to next message
Eclipse UserFriend
I've been told this is the proper place to ask the following question. I am
having a
problem when my plugin shuts down that seems to be JFace related. If it
should be posted elsewhere please let me know.

During shutdown I (often, but not always) get a NullPointerException from
from
org.eclipse.jface.resource.ImageRegistry in method destroyResource.

instance variable original is null. The Debug stack dump shows:

Eclipse Application [Eclipse Application]
org.eclipse.core.launcher.Main at localhost:1971
Thread [main] (Suspended (exception NullPointerException))
ImageRegistry$OriginalImageDescriptor.destroyResource(Object ) line: 93
DeviceResourceManager.deallocate(Object, DeviceResourceDescriptor) line:
63
DeviceResourceManager(AbstractResourceManager).dispose() line: 143
DeviceResourceManager.dispose() line: 80
JFaceResources$1.run() line: 189
Display.release() line: 3023
Display(Device).dispose() line: 262
IDEApplication.run(Object) line: 111
PlatformActivator$1.run(Object) line: 78
EclipseAppLauncher.runApplication(Object) line: 92
EclipseAppLauncher.start(Object) line: 68
EclipseStarter.run(Object) line: 400
EclipseStarter.run(String[], Runnable) line: 177
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]
NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available
Method.invoke(Object, Object[]) line: not available
Main.invokeFramework(String[], URL[]) line: 336
Main.basicRun(String[]) line: 280
Main.run(String[]) line: 977
Main.main(String[]) line: 952
Thread [State Data Manager] (Running)
Thread [Framework Event Dispatcher] (Running)
Thread [Start Level Event Dispatcher] (Running)
Thread [Worker-0] (Running)
Thread [derby.rawStoreDaemon] (Running)
Thread [derby.antiGC] (Running)
Thread [Worker-1] (Running)
C:\Program Files\Java\j2re1.4.2_05\bin\javaw.exe (14 Feb 2007 12:25:16)


The Debug Variables View shows:

this= ImageRegistry$OriginalImageDescriptor (id=2062)
original= null
originalDisplay= Display (id=2068)
refCount= 0

I presume that my code somewhere is abusing the Image Registry, but in
looking at variables associated with the program stack I cannot see anything
that gives me a clue about where the offending object might be -- indeed, I
can find no objects that relate to my code at all.

Any suggestions about how to track this down would be most appreciated (or a
pointer to the right place to ask the question).

Many thanks in advance.
Re: Tracking down the source of a NullPointerException during shutdown [message #463779 is a reply to message #463761] Thu, 15 February 2007 08:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi John,

Somewhere code is calling imageRegistry.put("key", imageVar) where
imageVar is null. You should use CTRL+ALT+H to track down where this
method is being called.

It doesn't throw an exception right where it happens, but in the dispose:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=130315

Later,
PW
Re: Tracking down the source of a NullPointerException during shutdown [message #463802 is a reply to message #463779] Thu, 15 February 2007 13:54 Go to previous message
Eclipse UserFriend
Although you are right Paul I think JFace also needs fixing! If you file
a bug I and assign it to me I can look at the details.

Tom

Paul Webster schrieb:
> Hi John,
>
> Somewhere code is calling imageRegistry.put("key", imageVar) where
> imageVar is null. You should use CTRL+ALT+H to track down where this
> method is being called.
>
> It doesn't throw an exception right where it happens, but in the dispose:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=130315
>
> Later,
> PW
Previous Topic:Problem with Progressview
Next Topic:How to shutdown RCP from within
Goto Forum:
  


Current Time: Wed Mar 26 08:22:33 EDT 2025

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

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

Back to the top