Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » bundle.getEntry() always returns null(Trivial code to get imageDescriptor doesn't work.)
bundle.getEntry() always returns null [message #676250] Fri, 03 June 2011 11:55 Go to next message
Erwin  is currently offline Erwin Friend
Messages: 10
Registered: June 2011
Junior Member

I am struggling with something that seems a trivial task for a day now, and I am completely lost! For some reason bundle.getEntry() just won't return the url of my resource. getResource() however DOES work.

I have checked, double checked an triple checked that the PLUGIN_ID is correct, that the filename is correct, desperately moved the resource around, added '/', and '.' to the image path, but to no avail.

Code and below.

Any help is highly appreciated.

Kind Regards,


image = getImageDescriptor("icons/myImage.jpg").createImage();

	private ImageDescriptor getImageDescriptor(String id){
//		URL url = Platform.getBundle(Activator.PLUGIN_ID).getResource(id); // Valid URL
//		URL url = Platform.getBundle(Activator.PLUGIN_ID).getEntry(id); // null
//		return ImageDescriptor.createFromURL(url);
		ImageDescriptor imd = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, id); // null
		return imd;
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
src.includes = META-INF/,\

Re: bundle.getEntry() always returns null - RESOLVED [message #676285 is a reply to message #676250] Fri, 03 June 2011 14:22 Go to previous message
Erwin  is currently offline Erwin Friend
Messages: 10
Registered: June 2011
Junior Member
So the file name was correct, and the plugin ID was correct, but for some reason, when I copied the file in Eclipse from one folder to another, it had not copied the file in the file system as well. After refreshing the project the file still showed up in Eclipse even though it wasn't there. Manually copied the file over, and that resolved the mystery.

Thanks for your attention.

Previous Topic:Prevent opening of the Java Stack Trace Console
Next Topic:How To send a Business Model opened in Editors in CNF View (Common Navigator Framework)
Goto Forum:

Current Time: Wed Aug 23 19:18:27 GMT 2017

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

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