Cannot find a file in my bundle [message #856509] |
Wed, 25 April 2012 18:38 |
loic Missing name Messages: 6 Registered: December 2011 |
Junior Member |
|
|
Hi,
I have a plugin that creates template files in a workspace project. The template file is stored in the bundle, my build.properties looks like:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
templates/
where the directory "templates/" hosts my template file.
In my plugin I have some code doing:
// Step 1: Find the template description file in the bundle
URL url = FileLocator.find(Platform.getBundle(Activator.PLUGIN_ID),
new Path(PROJECT_TEMPLATES_PATH + File.separator + projectType
+ File.separator + templateName), null);
if (url == null) ...{
where PROJECT_TEMPLATES_PATH is "templates"
When I test my plugin in my development Eclipse (Run As "Eclipse Application") it works fine, it can find the template "templates/foo/bar".
When I install the feature (that includes my plugin) in a fresh new Eclipse, it fails to find the "templates/foo/bar" template file. The file is in my plugin jar file, my plugin jar file is correctly installed in the <eclipse>/plugins directory. Actually the plugin works all fine except that it cannot find the template.
I checked the state of the bundle, it is in state ACTIVE.
I put some traces, and the code can find the bundle (i.e. "Platform.getBundle(Activator.PLUGIN_ID)" works fine) but it cannot find the entry...
Any reasons why ?
How can I find out the reason ? (any way to debug this?)
Thanks!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02650 seconds