【问题标题】:missing requirement osgi.wiring.package when starting bundle启动捆绑包时缺少要求 osgi.wiring.package
【发布时间】:2019-10-11 23:16:29
【问题描述】:

提前感谢您的帮助! 我正在学习一个教程,当我尝试启动我在 karaf 中安装的捆绑包时,它不会启动......日志是:

20:12:18.713 错误 [Karaf 本地控制台用户 karaf] 执行命令时捕获异常 org.apache.karaf.shell.support.MultiException:在捆绑包上执行命令时出错: 启动捆绑包 157 时出错:无法解析 db-examplejpa [157](R 157.0):缺少要求 [db-examplejpa [157](R 157.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(version>=0.6.0)(!(version>=1.0.0))) 未解决的要求:[[db-examplejpa [157] (R 157.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(version>=0.6.0)(!(version>=1.0.0)))] 在 org.apache.karaf.shell.support.MultiException.throwIf(MultiException.java:61) ~[?:?] 在 org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:70) ~[?:?] 在 org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:55) ~[?:?] 在 org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) ~[?:?] 在 org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) ~[?:?] 在 org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) ~[?:?] 在 org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?] 在 org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) ~[?:?] 在 org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?] 在 org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?] 在 org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?] 在 org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?] 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:?] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:?] 在 java.lang.Thread.run(Thread.java:748) [?:?] 抑制:java.lang.Exception:错误启动包 157:无法解析 db-examplejpa [157](R 157.0):缺少要求 [db-examplejpa [157](R 157.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(version>=0.6.0)(!(version>=1.0.0))) 未解决的要求:[[db-examplejpa [157] (R 157.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(version>=0.6.0)(!(version>=1.0.0)))] 在 org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:67) ~[?:?] 在 org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:55) ~[?:?] 在 org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) ~[?:?] 在 org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) ~[?:?] 在 org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) ~[?:?] 在 org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) ~[?:?] 在 org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) ~[?:?] 在 org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) ~[?:?] 在 org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) ~[?:?] 在 org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) ~[?:?] 在 org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) ~[?:?] 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:?] 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:?] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:?] 在 java.lang.Thread.run(Thread.java:748) [?:?] 原因:org.osgi.framework.BundleException:无法解析 db-examplejpa [157](R 157.0):缺少要求 [db-examplejpa [157](R 157.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(version>=0.6.0)(!(version>=1.0.0))) 未解决的要求:[[db-examplejpa [157] (R 157.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(version>=0.6.0)(!(version>=1.0.0)))] 在 org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4149) ~[?:?] 在 org.apache.felix.framework.Felix.startBundle(Felix.java:2119) ~[?:?] 在 org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) ~[?:?] 在 org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:38) ~[?:?] 在 org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:65) ~[?:?] ... 14 更多

有兴趣的教程就是这个:http://liquid-reality.de/Karaf-Tutorial/06/

我以为是版本问题,但我试图在pom中更改版本,但没有奏效。 我在这里似乎有一些答案,但没有运气......

编辑:顺便说一句,我没有使用 bndtool ... 是必需的吗? tut什么也没说

谢谢!

【问题讨论】:

    标签: eclipse osgi apache-karaf aries


    【解决方案1】:

    该示例不再匹配当前版本的 Apache Karaf 和 JPA。

    您看到的问题意味着我们使用了包“org.apache.felix.service.command”,但没有导出此包的包。在这种情况下,原因是此包中的注释已被弃用,并且当前 karaf 版本不再支持。

    我已经为当前的 Apache Karaf 调整了示例,并且还转换为使用基于 lambda 的 JPA 样式以及声明式服务而不是蓝图。这使示例变得相当简单。

    我希望这会有所帮助。

    【讨论】:

    • 非常感谢克里斯蒂安!你真棒!最好的问候,再次感谢!
    猜你喜欢
    • 2015-07-28
    • 2018-05-10
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-16
    • 2017-09-28
    • 1970-01-01
    相关资源
    最近更新 更多