Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Build path access to jar inside bundle
Build path access to jar inside bundle [message #270142] Thu, 09 April 2009 06:22 Go to next message
Philipp is currently offline PhilippFriend
Messages: 3
Registered: July 2009
Junior Member
Hello
I want to add an OSGi bundle in the build path, so that I can develop
with the libs which will be available when the app will be deployed on
OSGi. The bundle in question is servlet.jar as prepared by the Oscar
team (http://oscar-osgi.sf.net/repo/servlet/servlet.jar).

The structure of this bundle is, that it contains a manifest and a
javax.servlet.jar. The manifest, exports the relevant packages and the
internal classpath points to the jar.
<manifest>
(...)
Bundle-ClassPath: javax.servlet.jar
Export-Package: javax.servlet;specification-version=2.3.0,javax.servle
t.http;specification-version=2.3.0,javax.servlet.jsp;specifi cation-ve
rsion=2.3.0
</manifest>

When I add this bundle to the build path in eclipse, it can't resolve
the classes (for example javax.servlet.http.HttpServletRequest).

How can I make Eclipse find those classes which are in a jar in an OSGi
bundle?

Best regards
Philipp
Re: Build path access to jar inside bundle [message #270153 is a reply to message #270142] Thu, 09 April 2009 10:28 Go to previous messageGo to next message
Ankur Sharma is currently offline Ankur SharmaFriend
Messages: 84
Registered: July 2009
Member
Philipp wrote:
> Hello
> I want to add an OSGi bundle in the build path, so that I can develop
> with the libs which will be available when the app will be deployed on
> OSGi. The bundle in question is servlet.jar as prepared by the Oscar
> team (http://oscar-osgi.sf.net/repo/servlet/servlet.jar).
>
> The structure of this bundle is, that it contains a manifest and a
> javax.servlet.jar. The manifest, exports the relevant packages and the
> internal classpath points to the jar.
> <manifest>
> (...)
> Bundle-ClassPath: javax.servlet.jar
> Export-Package: javax.servlet;specification-version=2.3.0,javax.servle
> t.http;specification-version=2.3.0,javax.servlet.jsp;specifi cation-ve
> rsion=2.3.0
> </manifest>
>
> When I add this bundle to the build path in eclipse, it can't resolve
> the classes (for example javax.servlet.http.HttpServletRequest).
>
> How can I make Eclipse find those classes which are in a jar in an OSGi
> bundle?
>
> Best regards
> Philipp


How are you adding the bundle to build path? I suggest you do it using the Manifest Editor -> Dependencies page. Add your bundle here in "Required Plug-ins".

hth,
Ankur..
Re: Build path access to jar inside bundle [message #659622 is a reply to message #270153] Mon, 14 March 2011 20:12 Go to previous message
Greg Davis is currently offline Greg DavisFriend
Messages: 1
Registered: March 2011
Junior Member
Surely Philipp must have figured this out by now. But, I ran into the same problem recently. A class was required, which was hosted in a jar-file in a lib folder in an OSGi bundle-file. The appropriate namespaces were exported in the bundle's MANIFEST.MF. The only way for eclipse to resolve the classes from the jar nested in the bundle, was to explode the bundle file into a directory where the PDE is looking for plugins... err bundles. In other words, the exploded directory needs to be a subdirectory to some target-platform location.

gd
Previous Topic:After Eclipse Started....
Next Topic:User Library or Build Path or ??
Goto Forum:
  


Current Time: Tue Apr 23 07:36:16 GMT 2024

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

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

Back to the top