1

我们正在将基于 spring 的骆驼应用程序迁移到基于蓝图的骆驼应用程序。我们也在迁移到 fuse 6.1 版本。我正在使用Pax Exam 和 Junit runner 以及 apache felix 容器来执行我的单元测试。我面临与 ehcache 管理器相关的未解决捆绑问题的问题。我尝试将所需的依赖项提供给 pax 配置作为 mavenBundle 但没有任何运气。异常没有提供有关缺少依赖项的详细信息,而是仅提供包的一般错误,即“osgi.wiring.package=net.sf.ehcache”。
我在 pom.xnl 中给出了必要的依赖,而 Eclipse 没有显示任何错误。下面是 Junit 中使用的配置。

'@Configuration 公共选项[] config() {

    return options(systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("DEBUG"),
            systemProperty("Test.Property").value("system"),
            systemProperty("pax.exam.logging").value("none"),
            systemTimeout(600000),

            mavenBundle("commons-lang", "commons-lang", "2.5"),
            mavenBundle("commons-collections", "commons-collections", "3.2.1"),
            mavenBundle("commons-beanutils", "commons-beanutils", "1.8.3"),
            mavenBundle("commons-io", "commons-io", "2.0"),
            mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
            mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
            mavenBundle("org.slf4j", "slf4j-api", "1.7.5"),
            mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.5"),
            mavenBundle("net.sf.ehcache", "ehcache-core", "2.6.9"),
            mavenBundle("net.sf.ehcache", "ehcache", "1.5.0"),
            mavenBundle("org.apache.aries.blueprint", "org.apache.aries.blueprint", "1.1.0"),
            mavenBundle("org.apache.aries.proxy", "org.apache.aries.proxy", "1.0.0"),
            mavenBundle("org.apache.aries", "org.apache.aries.util", "1.1.0"),
            mavenBundle("channelservicelayer", "base", "1.0.0"),
            mavenBundle("asm", "asm-all", "3.1"),
            junitBundles()
            );
}'

我正在附加日志如下

---
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]:启用 SLF4J API 支持。
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]:启用 Jakarta Commons Logging API 支持。
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]:启用 Log4J API 支持。
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]:启用 Avalon Logger API 支持。
org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator]:启用 JULI Logger API 支持。
16:58:10.097 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.logging.pax-logging-api]
16:58:10.097 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.base]
16:58:10.097 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.swissbox.core]
16:58:10.097 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.swissbox.extender]
16:58:10.100 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.swissbox.framework]
16:58:10.100 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.swissbox.lifecycle]
16:58:10.100 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.swissbox.tracker]
16:58:10.100 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.apache.geronimo.specs.geronimo-atinject_1.0_spec]
16:58:10.101 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.ops4j.pax.tipi.junit]
16:58:10.102 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.apache.commons.lang]
16:58:10.103 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.apache.commons.collections]
16:58:10.105 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.apache.commons.beanutils]
16:58:10.106 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.apache.commons.io]
16:58:10.106 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [ch.qos.logback.core]
16:58:10.106 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [ch.qos.logback.classic]
16:58:10.106 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [slf4j.api]
16:58:10.107 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [jcl.over.slf4j]
16:58:10.116 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 启动蓝图扩展器...
16:58:10.288 [FelixStartLevel] INFO oaabcontainer.BlueprintExtender - 没有可用的静默支持,因此蓝图组件不会参与静默操作
16:58:10.289 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 蓝图扩展器已启动
16:58:10.289 [FelixStartLevel] 调试 oopsextender.BundleWatcher - 扫描包 [org.apache.aries.blueprint]
16:58:10.293 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 找到 ProxyManager 服务,开始处理蓝图包
16:58:10.295 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.apache.felix.framework
16:58:10.298 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.apache.felix.framework 中找不到蓝图应用程序
16:58:10.298 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.exam
16:58:10.299 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.exam 中找不到蓝图应用程序
16:58:10.300 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.exam.inject
16:58:10.300 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.exam.inject 中找不到蓝图应用程序
16:58:10.300 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.exam.extender.service
16:58:10.300 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.exam.extender.service 中找不到蓝图应用程序
16:58:10.300 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描捆绑包 osgi.cmpn
16:58:10.312 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 osgi.cmpn 中找不到蓝图应用程序
16:58:10.312 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.logging.pax-logging-api
16:58:10.313 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.logging.pax-logging-api 中找不到蓝图应用程序
16:58:10.313 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.base
16:58:10.314 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.base 中找不到蓝图应用程序
16:58:10.314 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.swissbox.core
16:58:10.315 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.swissbox.core 中找不到蓝图应用程序
16:58:10.315 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.swissbox.extender
16:58:10.315 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.swissbox.extender 中找不到蓝图应用程序
16:58:10.315 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.swissbox.framework
16:58:10.315 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.swissbox.framework 中找不到蓝图应用程序
16:58:10.315 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.swissbox.lifecycle
16:58:10.316 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.swissbox.lifecycle 中找不到蓝图应用程序
16:58:10.316 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.ops4j.pax.swissbox.tracker
16:58:10.316 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.ops4j.pax.swissbox.tracker 中找不到蓝图应用程序
16:58:10.316 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.apache.geronimo.specs.geronimo-atinject_1.0_spec
16:58:10.316 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.apache.geronimo.specs.geronimo-atinject_1.0_spec 中找不到蓝图应用程序
16:58:10.316 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.apache.commons.lang
16:58:10.317 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.apache.commons.lang 中找不到蓝图应用程序
16:58:10.317 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.apache.commons.collections
16:58:10.326 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.apache.commons.collections 中找不到蓝图应用程序
16:58:10.327 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.apache.commons.beanutils
16:58:10.330 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.apache.commons.beanutils 中找不到蓝图应用程序
16:58:10.330 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 扫描包 org.apache.commons.io 以获取蓝图应用程序
16:58:10.330 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 org.apache.commons.io 中找不到蓝图应用程序
16:58:10.330 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描捆绑包 ch.qos.logback.core
16:58:10.331 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 ch.qos.logback.core 中找不到蓝图应用程序
16:58:10.331 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描捆绑包 ch.qos.logback.classic
16:58:10.331 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 ch.qos.logback.classic 中找不到蓝图应用程序
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描捆绑包 slf4j.api
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 slf4j.api 中找不到蓝图应用程序
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 jcl.over.slf4j
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在捆绑包 jcl.over.slf4j 中找不到蓝图应用程序
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 启动捆绑包 null 的 BlueprintContainer 销毁过程
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 不是蓝图包或 BlueprintContainer 的破坏已经为 null 完成。
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 启动捆绑包 null 的 BlueprintContainer 销毁过程
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 不是蓝图包或 BlueprintContainer 的破坏已经为 null 完成。
16:58:10.332 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 为蓝图应用程序扫描包 org.apache.aries.blueprint
16:58:10.335 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 在包 org.apache.aries.blueprint 中找到蓝图应用程序,路径为:[bundle://23.0:0/OSGI-INF/blueprint/blueprint-cm.xml, bundle ://23.0:0/OSGI-INF/blueprint/blueprint-ext.xml]
16:58:10.351 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 异步调度创建蓝图包 org.apache.aries.blueprint
org.osgi.framework.BundleException:捆绑基础 [26] 中未解决的约束:无法解析 26.0:缺少要求 [26.0] osgi.wiring.package;(osgi.wiring.package=net.sf.ehcache)
    在 org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
    在 org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
    在 org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
    在 org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
    在 java.lang.Thread.run(Thread.java:745)
16:58:10.355 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 启动捆绑包 org.apache.aries.util 的 BlueprintContainer 销毁过程
16:58:10.355 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 不是蓝图包或 BlueprintContainer 的破坏已经为 org.apache.aries.util 完成。
16:58:10.355 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 启动捆绑包基础的 BlueprintContainer 销毁过程
16:58:10.355 [FelixStartLevel] 调试 oaabcontainer.BlueprintExtender - 不是蓝图包或 BlueprintContainer 的破坏已经为基础完成。

4

1 回答 1

1

我已经通过将 ehcache 版本升级到最新的 2.8.5 来解决这个问题。ehcache-core 期望的版本比我使用的 ehcache 的 1.5.2 版本更高。
对于像我这样的 osgi 初学者来说,更大的问题是没有得到正确的错误信息,这让我花费大量时间进行调查。

于 2015-01-19T04:49:31.150 回答