1
votes

I am not an experienced OSGi user yet and I get some problems consequently.

I am trying to use org.apache.servicemix.bundles.hadoop-client as an external hadoop provider because I don't want my bundle to contain all of those classes.

But when I run the set of bundles (my and org.apache.servicemix.bundles.hadoop-client) I get the following error:

ERROR: Bundle org.apache.servicemix.bundles.hadoop-client [56] Error starting file:bundles/org.apache.servicemix.bundles.hadoop-client_2.8.1.1.jar (org.osgi.framework.BundleException: Unable to resolve org.apache.servicemix.bundles.hadoop-client [56](R 56.0): missing requirement [org.apache.servicemix.bundles.hadoop-client [56](R 56.0)] osgi.wiring.package; (&(osgi.wiring.package=corg.osgi.framework.BundleException: Unable to resolve org.apache.servicemix.bundles.hadoop-client [56](R 56.0): missing requiremom.google.inject)(version>=3.0.0)(!(version>=4.0.0))) Unresolved requirements: [[org.apache.servicemix.bundles.hadoop-client [56ent [org.apache.servicemix.bundles.hadoop-client [56](R 56.0)] osgi.wiring.package; (&(osgi.wiring.package=com.google.inject)(ve](R 56.0)] osgi.wiring.package; (&(osgi.wiring.package=com.google.inject)(version>=3.0.0)(!(version>=4.0.0)))]) rsion>=3.0.0)(!(version>=4.0.0))) Unresolved requirements: [[org.apache.servicemix.bundles.hadoop-client [56](R 56.0)] osgi.wiring.package; (&(osgi.wiring.package=com.google.inject)(version>=3.0.0)(!(version>=4.0.0)))] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111) at org.apache.felix.framework.Felix.startBundle(Felix.java:2117) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) at java.lang.Thread.run(Thread.java:748)

I understand that org.apache.servicemix.bundles.hadoop-client imports com.google.inject and expects that some other bundle exports it.

My own bundle imports com.google.inject as well and it works properly. The only difference is that my bundle uses version 3.0 and hadoop wants 4.0.

Both of the com.google.inject 3.0 and 4.0 bundles are in the osgi_container/bundles folder.

I've even tried to force my bundle to <export-package> com.google.inject and it "worked". The error began to ask for another library. </stupid attemtps>

So I'm stuck at the point. Thanks for any advice.

1

1 Answers

2
votes

The core of the exception above is this

(&(osgi.wiring.package=com.google.inject)(version>=3.0.0)(!(version>=4.0.0)))

It means that the hadoop-client needs a bundle that exports the package com.google.inject in a version [3.0.0,4.0.0). This means all package versions from 3.0.0 until excluding 4.0.0 should be valid.

As mentioned in the comment by PanzOr google guice seems to export the package com.google.inject in a different version. The newest guice exports the version 1.4. So it seems the hadoop client bundle might be broken. As its import range uses the bundle version not the actual package version.

Btw. I gave up installing any big data project in OSGi. They all seem to have hughe dependency trees with a lot of non OSGi dependencies. So they are really hard to install.