OSGi'使用约束违规'使用logback

时间:2015-11-30 19:40:19

标签: osgi bndtools

bndtools Eclipse插件始终报告' 使用约束违规'对于我无法追踪的 logback (我已经完成了可以在StackOverflow和Google上找到的每个相关问题)。

每次修改' 运行配置&#39>时,都会显示约束违规。在足够的项目清理/重建和Eclipse重新启动之后最终消失(对各种神的嘀咕调用以及偶尔的鸡牺牲也可能与它有关)。

我的工作区中没有任何内容似乎直接导出 logback ,因此不清楚导致两个冲突链的原因 - 它可能是Felix捆绑包或SLF4J之一,但似乎也是如此不可能的。

捆绑包的部分列表:

osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.log)',\
osgi.identity;filter:='(osgi.identity=slf4j.api)',\
osgi.identity;filter:='(osgi.identity=ch.qos.logback.core)',\
osgi.identity;filter:='(osgi.identity=ch.qos.logback.classic)',\

约束违规报告:

Uses constraint violation. Unable to resolve resource ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] because it is exposed to package 'ch.qos.logback.classic.spi' from resources ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] and ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] via two dependency chains.

Chain 1:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]

Chain 2:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0)(!(version>=2.0.0)))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] because it is exposed to package 'ch.qos.logback.classic.spi' from resources ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] and ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2] via two dependency chains.

Chain 1:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]

Chain 2:   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]
    import: (&(osgi.wiring.package=ch.qos.logback.classic.spi)(version>=1.1.0)(!(version>=2.0.0)))
     |
    export: osgi.wiring.package: ch.qos.logback.classic.spi   ch.qos.logback.classic [ch.qos.logback.classic ver=1.1.2]     at org.apache.felix.resolver.ResolverImpl.checkDynamicPackageSpaceConsistency(ResolverImpl.java:1133)   at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1086)  at org.apache.felix.resolver.ResolverImpl.checkDynamicPackageSpaceConsistency(ResolverImpl.java:1402)   at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1086)  at org.apache.felix.resolver.ResolverImpl.checkDynamicPackageSpaceConsistency(ResolverImpl.java:1402)   at org.apache.felix.resolver.ResolverImpl.checkPackageSpaceConsistency(ResolverImpl.java:1086)  at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:260)    at biz.aQute.resolve.ResolveProcess.resolveRequired(ResolveProcess.java:34)     at org.bndtools.core.resolve.ResolveOperation.run(ResolveOperation.java:61)     at org.bndtools.core.resolve.ResolveJob.run(ResolveJob.java:43)     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

有没有办法解决这个问题?我甚至真的很高兴只有一致的解决方法..

0 个答案:

没有答案