Unable to resolve dependencies from manually deployed OSGI bundle having spring-redis dependency

Solution Verified - Updated -

Issue

  • User is trying to deploy routes to a Karaf container without Fabric.
  • There seems to be no problem building the jar file using the maven-bundle-plugin.
  • However, after it is deployed it does not resolve the dependencies.
  • If user check out what got deployed in hawtio under the OSGI tab and check out bundles user can find bundle by its name and its State is installed but the route is throwing errors on start.
  • Hot Deployment matches the deployment model user is targeting. Hence installing features or bundle using console command is not preferred.
  • Following exception is received after deploy the bundle directly within deploy folder.
Error while starting bundle: file:/path_of_bundle/custom_bundle.jar
Stack Trace:
org.osgi.framework.BundleException: Unresolved constraint in bundle com.xxz.yyy [255]: Unable to resolve 255.0: missing requirement [255.0] osgi.wiring.package; (osgi.wiring.package=org.json)
  at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4225)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]
  at org.apache.felix.framework.Felix.startBundle(Felix.java:2063)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]
  at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.0.3.redhat-610379.jar:]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[org.apache.felix:org.apache.felix.fileinstall:3.3.11.redhat-610379]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[org.apache.felix:org.apache.felix.fileinstall:3.3.11.redhat-610379]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[org.apache.felix:org.apache.felix.fileinstall:3.3.11.redhat-610379]
  at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[org.apache.felix:org.apache.felix.fileinstall:3.3.11.redhat-610379]

Environment

  • Red Hat JBoss Fuse
    • 6.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content