Fuse Fabric: org.osgi.framework.BundleException regarding Scala and Swagger libraries at container start-up

Solution Verified - Updated -

Issue

  • When starting a Fabric managed container that deploys multiple profiles, it sometimes raises the following error at startup. This happens purely when using the out-of-the-box profiles of Fabric.
    2018-03-06 11:10:58,729 | ERROR | lixDispatchQueue | swagger-jaxrs                    | 350 - org.apache.servicemix.bundles.swagger-jaxrs - 1.3.12.3 | FrameworkEvent ERROR - org.apache.servicemix.bundles.swagger-jaxrs
    org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision org.apache.servicemix.bundles.swagger-jaxrs [350.0] because it is exposed to package 'scala.util.matching' from bundle revisions org.scala-lang.scala-library [365.0] and org.scala-lang.scala-library [366.0] via two dependency chains.

    Chain 1:
      org.apache.servicemix.bundles.swagger-jaxrs [350.0]
        import: (&(osgi.wiring.package=scala.util.matching)(version>=2.10.0)(!(version>=3.0.0)))
         |
        export: osgi.wiring.package=scala.util.matching
      org.scala-lang.scala-library [365.0]

    Chain 2:
      org.apache.servicemix.bundles.swagger-jaxrs [350.0]
        import: (osgi.wiring.package=com.wordnik.swagger.core.filter)
         |
        export: osgi.wiring.package=com.wordnik.swagger.core.filter; uses:=com.fasterxml.jackson.module.scala
      org.apache.servicemix.bundles.swagger-core [349.0]
        import: (&(osgi.wiring.package=com.fasterxml.jackson.module.scala)(version>=2.4.0)(!(version>=3.0.0)))
         |
        export: osgi.wiring.package=com.fasterxml.jackson.module.scala; uses:=scala
      com.fasterxml.jackson.module.jackson.module.scala [270.0]
        import: (&(osgi.wiring.package=scala)(version>=2.10.0)(!(version>=3.0.0)))
         |
        export: osgi.wiring.package=scala; uses:=scala.util.matching
        export: osgi.wiring.package=scala.util.matching
      org.scala-lang.scala-library [366.0]
            at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4006)[org.apache.felix.framework-4.4.1.jar:]
            at org.apache.felix.framework.Felix.startBundle(Felix.java:2045)[org.apache.felix.framework-4.4.1.jar:]
            at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)[org.apache.felix.framework-4.4.1.jar:]
            at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)[org.apache.felix.framework-4.4.1.jar:]
            at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]

Environment

  • JBoss Fuse 6.x
  • Fabric

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.