Re: [equinox-dev] Resource not found inside bundle

2014-07-28 Thread Raymond Auge
That file is not in the classpath of the bundle and so you can't use the resource API. However, you can use the entry API (which talks about the bundle rather than about the bundle's classpath). e.g. URL url = bundle.getEntry(api_mapping.xml); IF you have a class however, and you need to get

[equinox-dev] Resource not found inside bundle

2014-07-28 Thread David Cao
Hello there, I have a bundle jar file basically converted from a .war file, with Bundle-ClassPath set as follow, Bundle-Localization: plugin Bundle-ClassPath: *WEB-INF/classes*, WEB-INF/lib/activation-1.1.jar, WEB-INF/lib/antlr-2.7.5.jar, ... Import-Package: javax.servlet, javax.servlet.http,

Re: [equinox-dev] Resource not found inside bundle

2014-07-28 Thread BJ Hargrave
That file does appear to be in the classpath. The picture shows it in WEB-INF/classes which is in the Bundle-ClassPath. What does the code look like that is trying to access the file? -- BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance hargr...@us.ibm.com

Re: [equinox-dev] Resource not found inside bundle

2014-07-28 Thread Raymond Auge
Yup, sorry, I fudged on the image. On Mon, Jul 28, 2014 at 1:14 PM, BJ Hargrave hargr...@us.ibm.com wrote: That file does appear to be in the classpath. The picture shows it in WEB-INF/classes which is in the Bundle-ClassPath. What does the code look like that is trying to access the file?

Re: [equinox-dev] Resource not found inside bundle

2014-07-28 Thread David Cao
So I see conflict answers ... [?] To Raymond, I will give a quick try from the Activator of your method. Thank!! To BJ, the code is something like this, ClassLoader loader = Thread.currentThread().getContextClassLoader(); ... EnumerationURL urls = loader.getResources(api_mapping.xml); ... Do

Re: [equinox-dev] Resource not found inside bundle

2014-07-28 Thread BJ Hargrave
The problem is: What is the context class loader of the thread? Did you set one up? OSGi is generally mute on the subject of context class loaders and does not mess with them. Since you know that the resource is visible to your bundle, it would be better to use your class' class loader to call