3 Replies Latest reply on Jun 20, 2009 7:28 PM by Oren Livne

    How to install a non-OSGi maven jar as an OSGi bundle in FUSE?

    Oren Livne Novice

      Dear All:

       

      I have encountered a specific problem in FUSE ServiceMix ESB 4.1 that is

      seriously hampering my current development. I was wondering if you,

      Scott or another expert could kindly help. I looked around in the forums

      and the maven bnd plugin documentation, but could not find an answer

      anywhere.

       

      I have a non-OSGi legacy maven jar project called core-util, which I

      would like to use as a dependency to my FUSE component maven projects.

      When I tried

       

      osgi/install -s mvn:edu.utah.further.core/core-util

       

      it installed it, but did not start the bundle, as there is no manifest

      in this jar. Consequently, I replaced the core-util pom with the pom

      attached to this email, which should now make it an OSGi bundle.

      However, now I am getting:

       

      ERROR CommandLineExecutionFailed:

      org.apache.geronimo.gshell.command.CommandExce

      ption: org.osgi.framework.BundleException: Unresolved constraint in

      bundle 160:

      package; (package=javanet.staxutils)

       

      If I add javanet.staxutils to the Export-Package header, it works, but

      then complains on a different package. After repeating the process for

      30 other packages, I was discouraged and tried to use the

      Embed-Dependency header. This forced me to add some dependencies seen at

      the end of the  block, such as quartz, to be able to see

      the package. This is obviously a bad solution and I am not sure how many

      more packages would be required for the ESB to recognize core-util

      including all of its dependencies, so that it could be started and

      recognized by other OSGi bundles. It is also weird that the maven

      project can be compiled and run, i.e. the classpath contains all the

      required dependencies, albeit ServiceMix does not know how to extract

      and use them inside the OSGi environment.

       

      What is the proper procedure to import a non-OSGi maven module in my

      local maven repository into ESB, so that it could be used by OSGi bundles?

       

      A side question: when I type "log/d" at the shell, I often get the

      entire log file from the beginning of the servicemix installation. Is

      there a way to clear the log while ServiceMix is running?wait

       

      Thank you so much in advance,

      Oren

       

      -


      core-util pom.xml -