【问题标题】:Unknown namespace for jpa - ServiceMixjpa 的未知命名空间 - ServiceMix
【发布时间】:2017-01-16 16:42:21
【问题描述】:

我正在尝试遵循一个简单的教程,使用蓝图将简单的 CRUD 接口公开为 REST 服务 github link to tutorial code

部署到 serviceMix 时,出现以下错误:

java.lang.IllegalArgumentException: Unknown namespace for jpa: http://cxf.apache.org/schemas/configuration/cxf-beans.xsd

不知道为什么,我安装了和教程features一样的features

我也有同样的maven dependencies dependencies

我的bundle:list 给出以下list of bundles

bundlesstate:failure 由于这个问题而失败

有什么想法吗?

更新 1:

blueprintblueprint的内容

我也在使用blueprint-maven-plugin,它会生成以下generated blueprint

更新 2:

正如 Christian Schneider 所建议的,安装 aries-jpa 2.5.0 解决了这个问题,但发生了一件奇怪的事情: 之前,当我安装 2.3.0 版本时,我安装了以下 aries 相关捆绑包:

254 | Active  |  80 | 2.3.0 | Apache Aries JPA Container API
255 | Active  |  80 | 2.3.0 | Apache Aries JPA blueprint
256 | Active  |  80 | 2.3.0 | Apache Aries JPA container
257 | Active  |  80 | 2.3.0 | Apache Aries JPA support

现在我有了 2.5.0,在执行 bundle:list 时不再显示这些捆绑包

feature:list 显示如下

jpa| 2.5.0|| Started| aries-jpa-2.5.0| OSGi Persistence Container

所以问题是,我是否应该担心这些捆绑包不再显示?

【问题讨论】:

    标签: java rest osgi cxf blueprint-osgi


    【解决方案1】:

    感谢蓝图内容。我的第一个答案走错了路。

    错误原因是the issue ARIES-1600 in aries jpa。该问题已在 Aries JPA 2.5.0 中得到修复。您可以通过将此功能 repo url 添加到您的功能来使用它:

    mvn:org.apache.aries.jpa/jpa-features/2.5.0/xml/features
    

    如果你从命令行安装,你可以使用:

    功能:repo-add aries-jpa 2.5.0

    【讨论】:

    • 谢谢,这解决了问题,我还有一个相关的问题(更新2)
    • 安装包的数量在 aries jpa 2.5.0 和 2.3.0 之间不应该不同。当我做一个 la -s | grep jpa 我看到了通常的 4 个包。
    • 做 la -s | grep jpa 确实显示了通常的包,它与 bundle:list 有什么不同?
    • 是的。 bundle:list 仅显示具有高启动级别的捆绑包。你也可以使用 bundle:list -t 0
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-09
    • 2011-12-19
    • 1970-01-01
    相关资源
    最近更新 更多