由于Karaf中jackson.annotation的依赖冲突,无法解析bundle

时间:2016-06-28 12:31:48

标签: apache-felix apache-karaf apache-servicemix

启动捆绑包(basecomponent)时有一段时间我收到以下错误。似乎是因为fasterxml.jackson.annotations的两个不同版本。 basecomponent包正在使用fasterxml.jackson.annotations 2.7.4。 basecomponent捆绑包也在使用camel-aws,可能正在使用fasterxml.jackson.annotation 2.5.0。

smx@root>bundle:start 277
Error executing command: Error executing command on bundles:
    Unable to execute command on bundle 277: Uses constraint violation. Unable to resolve bundle revision basecomponent [277.0] because it is exposed to package 'com.fasterxml.jackson.annotation' from bundle revisions com.fasterxml.jackson.core.jackson-annotations [284.0] and com.fasterxml.jackson.core.jackson-annotations [125.0] via two dependency chains.

Chain 1:
  basecomponent [277.0]
    import: (&(osgi.wiring.package=com.fasterxml.jackson.annotation)(version>=2.7.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=com.fasterxml.jackson.annotation
  com.fasterxml.jackson.core.jackson-annotations [284.0]

Chain 2:
  basecomponent [277.0]
    import: (osgi.wiring.package=com.amazonaws)
     |
    export: osgi.wiring.package=com.amazonaws; uses:=com.fasterxml.jackson.annotation
  org.apache.servicemix.bundles.aws-java-sdk [254.0]
    import: (&(osgi.wiring.package=com.fasterxml.jackson.annotation)(version>=2.5.0)(!(version>=3.0.0)))
     |
    export: osgi.wiring.package=com.fasterxml.jackson.annotation
  com.fasterxml.jackson.core.jackson-annotations [125.0]

有人可以告诉我如何解决这种依赖性冲突?我在Karaf 3.0.5下使用Servicemix 6.1.0

1 个答案:

答案 0 :(得分:0)

正如Karaf source code in the Developer Resources所述。移至Karaf 4.0.5Servicemix 7.0.0.M2下)并在dependency=true设置feature.xml我现在没有观察到此问题。