I’m developing an osgi bundle which requires org.apache.http packages. The target platform has a httpcommponents bundle which has these packages because I’ve seen them when I’ve declared in the bundle’s manifest these dependencies and eclipse automatically added the bundle in the plug-in dependecies list. The problem is that I get compile errors when I import org.apache.http. If I explore the bundle, it only has an Activator in the package org.apache.http and has in a lib folder the jars with the packages I need. How can I access those packages? Start the activator and get the classes I need at runtime? A solution can be to manually add the org.apache.http jar to my bundle’s build path. Sorry if it’s a silly question…
Thanks
You may want to look at this question, with regards to your build problem. Whoever built you target platform is taking the wrong approach, which is what is causing your grief.
Your target platform should in fact use the OSGi versions of the commons libraries. Where OSGi ready versions are not available, you can get them from Springsource bundle repository.
If this is not a possiblity (to fix this problem), then you can simply change your classpath for your build to include the appropriate libraries. It should already work at runtime regardless.
PS – It is not a silly question 😉