3 Replies Latest reply on Mar 6, 2013 8:38 PM by Freeman(Yue) Fang

    karaf service bundle conflict with 3rd library bundle - split package issue

    Li Wang Newbie

      In my project. I want to use packages from org.slf4j/slf4j.api/1.64. But the service bundle org.ops4j.pax.logging/pax-logging-api provide the same package as slf4j.api. Both provide packages like:

      org.slf4j              org.slf4j.helpers             org.slf4j.spi

       

      This results in split package issue in my project:

       

      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

       

      In this case. Both ch.qos.logback.classic and org.ops4j.pax.logging.pax-logging-api export package org.slf4j.spi which leads the split package issue.

       

      I am wondering if I can stop the service bundel pax-logging-api. I want to know what will happen if a pre-installed service bundle is stopped.

      Or can i find a osgi version bunlde for ch.qos.logback.classic and org.slf4j.spi? In the previous case, Freeman just tells me that I can use a osgi version bunlde httpclient-osgi to replace httpclient.