Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Required Plugin does not find it's own bundle!?
Required Plugin does not find it's own bundle!? [message #672468] Sat, 21 May 2011 03:08 Go to next message
Marco Lopes is currently offline Marco Lopes
Messages: 56
Registered: September 2010
Member
I have this scenario that is driving me nuts:

I have a Plugin A - This plugin has some resources (folders & files) that are used by it.
Then, i have a Plugin B that REQUIRES Plugin A

I RUN plugin A from Eclipse - OK!
I RUN plugin A from Export - OK!
I RUN plugin B from Eclipse - OK!
I RUN plugin B from Export - OK!

SO, i exported plugin A - let's call it EA (exported A)
I then create a new Plugin from existing JAR - using EA - let's call it C
I then configure C (Dependencies, etc) and Plugin B to use Plugin C
I RUN plugin B form Eclipse - ERROR! FileLocator returns NULL from plugin C! (or maybe getBundle, i have to debug).

The point is: What's wrong with this scenario??!

The code i use to locate the bundle is the following:

private static URI locateFile(String bundle, String fullPath) {
try {
URL url = FileLocator.find(Platform.getBundle(bundle), new Path(fullPath), null);
if(url != null)
return FileLocator.resolve(url).toURI();

} catch (Exception e) {}

return null;
}

[Updated on: Sat, 21 May 2011 03:27]

Report message to a moderator

Re: Required Plugin does not find it's own bundle!? [message #674114 is a reply to message #672468] Wed, 25 May 2011 16:56 Go to previous message
Marco Lopes is currently offline Marco Lopes
Messages: 56
Registered: September 2010
Member
Resolved.

I must pass the BUNDLE. Does not work if i try to "resolve" its name.

private static URI locateFile(Bundle bundle, String fullPath) {

try {
URL url = FileLocator.find(bundle, new Path(fullPath), null);
if(url != null)
return FileLocator.resolve(url).toURI();

} catch (Exception e) {
e.printStackTrace();
}

return null;

}
Previous Topic:[org.apache.catalina.core.StandardContext] Error in dependencyCheck
Next Topic:How do I display and/or select class list in my plugin
Goto Forum:
  


Current Time: Wed Jul 23 05:58:01 EDT 2014

Powered by FUDForum. Page generated in 0.01784 seconds