0

I am developing an application on opendaylight Carbon (based on Karaf). I need to use a library (specifically dnsjava) in my bundle. How do I go about including this?

I tried the following which did not work:

  1. In my features/pom.xml, I included a mvn dependency for my jar file.

  2. In my features/src/main/features/features.xml, I added a bundle:

    <bundle>wrap:mvn:dnsjava/dnsjava/${dnsjava.version}</bundle>
    

However, I still have an error when I go to start my feature:

    Error executing command: Error executing command on bundles:
Unable to execute command on bundle 278: The bundle "gov.nist.sdnmud.impl_0.1.0.SNAPSHOT [278]" could not be resolved. Reason: Missing Constraint: Import-Package: org.xbill.DNS; version="[2.1.0,3.0.0)"

Thanks for any help.

1 Answers1

0

I'm not an expert, but if the artifact doesn't have OSGi properties in the jar, which is likely why you've added the "wrap" prefix, then you have to manually set the required OSGi properties on the features.xml dependency line, in an odd microformat syntax.

In our environment, we have to do something like this:

wrap:mvn:<group>/<artifact>/<version>$Bundle-SymbolicName=<bundlename>&amp;Bundle-Version=<version>

This issue doesn't have anything to do with opendaylight.

David M. Karr
  • 14,317
  • 20
  • 94
  • 199
  • I did what you suggested. However, I still cannot start the dnsjava bundle. Error executing command on bundles: Unable to execute command on bundle 277: The bundle "dnsjava_2.1.8 [277]" could not be resolved. Reason: Missing Constraint: Import-Package: android.os; version="0.0.0" – LostInTheFrequencyDomain Sep 24 '17 at 16:26