11 Replies Latest reply on Mar 14, 2013 3:40 AM by Claus Ibsen

    OSGi dependency issue - need help in deploying maven bundle to OSGi contain

    Li Wang Newbie

      I want to deploy a mavenized project floodlight to Fuse esb OSGi container. Here is what I did so far:


      1. Download maven project:

          git clone https://github.com/oshothebig/floodlight.git


      2. go to download project floder:

          cd floodlight

          git checkout -b maven origin/maven

          mvn install


      3. work with eclipse

          mvn eclipse:eclipse


      4. import this maven project

          eclipse - import - existing maven projects - choose floodlight


      5. Create the FloodlightLaunch target:

          Click Run->Run Configurations

          Right Click Java Application->New

            Name: FloodlightLaunch

            Project: floodlight

            Main: net.floodlightcontroller.core.Main

          Click Apply

          run - maven install -> got floodglight.jar in target folder


      6.  deploy floodlight.jar to osgi container

           the floodlight project has many dependency. In the referenced library, there are 28 jar files. So I copy each of them from .m2 repository to Fuse deploy folder (/opt/Fuse-ESB/deploy). Then I got dependency resolution issues among these dependencies, for example:


      Unable to start bundle 386: Uses constraint violation. Unable to resolve bundle revision slf4j.api [386.0 because it exports package 'org.slf4j.spi' and is also exposed to it from bundle revision org.ops4j.pax.logging.pax-logging-api [4.0 via the following dependency chain:


      slf4j.api [386.0

      import: (&(osgi.wiring.package=org.slf4j.impl)(version>=1.6.0))


      export: osgi.wiring.package=org.slf4j.impl; uses:=org.slf4j.spi

      ch.qos.logback.classic [385.0

      import: (&(osgi.wiring.package=org.slf4j.spi)(version>=1.6.0))


      export: osgi.wiring.package=org.slf4j.spi

      org.ops4j.pax.logging.pax-logging-api [4.0


      org.ops4j.pax.logging.pax-logging-api is a service bundle in karaf. slf4j.api and ch.qos.logback.classic are floodlight dependencies I put in the deploy folder. Can anyone help me with this?