Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo Repository
Virgo Repository [message #784016] Thu, 26 January 2012 23:45 Go to next message
Geoffry Roberts is currently offline Geoffry Roberts
Messages: 27
Registered: March 2011
Junior Member
All,

I have some 3rd party libraries that I need for one of my bundles. As I understand the documentation, I should be able to copy these into the repository/usr directory and my bundle will then be able to find them. It cannot. My bundle won't start and the error message is complaining about these libraries not being found.

The libraries in question are not bundles just plain old jar files. I use them all the time in other java applications.

Is my understanding of all this correct?

Resolver report:
An Import-Package could not be resolved. Caused by missing constraint in bundle <OBHFrequency_1.0.0.201201261517>
constraint: <Import-Package: org.apache.hadoop.mapreduce.lib.input; version="0.0.0">

Thanks
Re: Virgo Repository [message #784235 is a reply to message #784016] Fri, 27 January 2012 08:30 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I'm afraid you need to convert plain old jar files into bundles using bundlor or bnd, for example.
Re: Virgo Repository [message #784237 is a reply to message #784016] Fri, 27 January 2012 08:32 Go to previous messageGo to next message
Frieder Heugel is currently offline Frieder Heugel
Messages: 61
Registered: October 2010
Location: Basel, CH
Member
Hi

As far as I know your libraries must be valid OSGi bundles otherwise they will not get picked up. You have several options here.

1.) Check one of the OSGi bundle repositories that are available online, e.g. SpringSource EBR - http://ebr.springsource.com/repository/app/

2.) Transform your library into a valid OSGi bundle. There are quite a lot of tools to do that, like bnd and Eclipse PDE. I'm not sure but IIRC bundlor is also able to do that.

3.) Embed the libraries inside an OSGi bundle's classpath and export the packages. Again there are tools to do that, e.g. Eclipse PDE or the maven-bundle-plugin/bnd.
Re: Virgo Repository [message #784534 is a reply to message #784237] Fri, 27 January 2012 17:07 Go to previous messageGo to next message
Geoffry Roberts is currently offline Geoffry Roberts
Messages: 27
Registered: March 2011
Junior Member
Thanks for the thoughtful responses.

Alas, making bundles of these jars--which are all the stuff it takes to access hadoop--was one of the first things I tried. I quickly found myself sojourning in dependency hell. Hence, I am looking for a way to put these packages on the main Virgo classpath. Is such a thing is possible?

I must say that as much as I like OSGi incorporating legacy code can be a nightmarish experience.

Thanks
Re: Virgo Repository [message #786325 is a reply to message #784534] Mon, 30 January 2012 09:17 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I'm afraid putting JARs on the main Virgo classpath is an anti-pattern that I wouldn't recommend. It can be done by adding those JARs into the set that are used to launch Virgo and then exporting the relevant packages from the system bundle via the java6-server.profile, but Virgo was not designed with this use case in mind, so you may not get very far.

Have you posted on hadoop mailing lists to see if someone else had created OSGi bundles they could share?
Previous Topic:War File URL Virgo vs Jetty
Next Topic:Virgo Tooling - Third party bundles
Goto Forum:
  


Current Time: Wed Oct 01 06:16:18 GMT 2014

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

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