0
votes

I am currently trying to convert the datastax core java driver to OSGi equivalent bundle but keep getting errors.

The version I am using is

<dependency>
<groupId>com.datastax.cassandra</groupId>
    <artifactId>cassandra-driver-core</artifactId>
<version>2.0.0-beta1</version>
 </dependency>
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle MyFramework [1]: Unable to resolve 1.0: missing requirement [1.0] osgi.wiring.package; (&(osgi.wiring.package=com.codahale.metrics)(version>=3.0.0)(!(version>=4.0.0)))
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
    at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:942)
    at com.ebay.mypackage.InitializeOSGiFramework.installAndStartBundle(InitializeOSGiFramework.java:307)

Any pointers are highly appreciated. Has anyone worked on converting datastax to an OSGi bundle?

1

1 Answers

1
votes

You are missing http://jpm4j.org/#!/p/com.codahale.metrics/metrics-core

This seems to be an OSGi bundle ... You might have more missing dependencies, look at your imports. Notice that in a non-OSGi world these missing dependencies are undetected, in the case the dependency is unnecessary, make it an optional import.

If you use bndtools, you get a nice GUI to look at these imports as well as making it easy to fix these issues.