0
votes

I am adding the following dependency to my OSGI bundle:

<dependency>
    <groupId>org.antlr</groupId>
    <artifactId>antlr4</artifactId>
    <version>4.7</version>
</dependency>

But I am getting the following error when I include mycom.myProject.Antlr.* in <Private-Package>:

ERROR: Bundle mycom.myProject.BundleFile [241] Error starting file:/C:/username/apache-servicemix-7.0.0.M2/deploy/BundleFile-1.0.0.jar (org.osgi.framework.BundleException: Unable to resolve mycom.myProject.BundleFile [241](R 241.76): missing requirement [mycom.myProject.BundleFile [241](R 241.76)] osgi.wiring.package; (&(osgi.wiring.package=org.antlr.v4.runtime)(version>=4.7.0)(!(version>=5.0.0))) Unresolved requirements: [[mycom.myProject.BundleFile [241](R 241.76)] osgi.wiring.package; (&(osgi.wiring.package=org.antlr.v4.runtime)(version>=4.7.0)(!(version >=5.0.0)))])

How can I resolve it?

1
Can you share your manifest.mf file ?JFPicard
Bundle-Name: MyProject::BundleFile Bundle-SymbolicName: mycom.MyProject.BundleFile Bundle-Version: 1.0.0 BundleType: MyProject Created-By: Apache Maven Bundle Plugin Import-Package: android.util,javax.jms;version="[1.1,2)",javax.net,javax .net.ssl,javax.security.auth.x500,org.antlr.v4.runtime;version="[4.7,5) ",org.antlr.v4.runtime.atn;version="[4.7,5)",org.antlr.v4.runtime.dfa;v ersion="[4.7,5)",org.antlr.v4.runtime.tree;version="[4.7,5)",org.apache .activemq;version="[5.7,6)",org.apache.camel.osgi,org.osgi.framework;ve rsion="[1.8,2)" Tool: Bnd-1.50.0CoderX

1 Answers

0
votes

If I read correctly your log, OSGI want an antlr version >= 4.7.0. But there is only a 4.7 version.

Try to change all the version entry in your manifest.mf for antlr to something like:

version="4.7",

Also, there is space between the end of the version and the ". Maybe try

org.antlr.v4.runtime;versi‌​on="[4.7,5)" instead of

org.antlr.v4.runtime;versi‌​on="[4.7,5) "