如何让 Spring Dynamic Modules 2.x 在 Apache Felix Karaf 上工作?
我们开始在一个项目中使用 Apache Felix Karaf,并利用 Blueprint Services。
现在,我想使用 Spring 动态模块来访问高级 DI 功能和测试功能。问题是我一直无法弄清楚如何让 Spring DM 2.x 在 Felix 上运行。
spring 和 spring-dm 功能已安装:
karaf@root> features:list
State Version Name Repository
[installed ] [2.5.6.SEC01] spring karaf-1.6.0
[installed ] [1.2.0 ] spring-dm karaf-1.6.0
[uninstalled] [1.6.0 ] wrapper karaf-1.6.0
[uninstalled] [1.6.0 ] obr karaf-1.6.0
[installed ] [1.6.0 ] http karaf-1.6.0
[uninstalled] [1.6.0 ] war karaf-1.6.0
[uninstalled] [1.6.0 ] webconsole karaf-1.6.0
[installed ] [1.6.0 ] ssh karaf-1.6.0
[installed ] [1.6.0 ] management karaf-1.6.0
但是为了使用 Blueprint 服务,我需要 Spring DM 2.x(至少根据 Spring 网站,“对于 Blueprint Service RI,请使用 2.x+ 版本。”) 。
我发现可以向 Apache Felix 添加功能,但从我的情况来看可以理解,这需要在某个存储库上声明一个 features.xml 文件。
我的问题是,是否有更简单的方法,也更集成(例如通过 Maven)
We started using Apache Felix Karaf for a project, and make use of Blueprint Services.
Now, I would like to use Spring Dynamic Modules in order to have access to advanced DI functionality and testing features. The problem is that I haven't been able to figure out how to get Spring DM 2.x running on Felix.
The spring and spring-dm features are installed:
karaf@root> features:list
State Version Name Repository
[installed ] [2.5.6.SEC01] spring karaf-1.6.0
[installed ] [1.2.0 ] spring-dm karaf-1.6.0
[uninstalled] [1.6.0 ] wrapper karaf-1.6.0
[uninstalled] [1.6.0 ] obr karaf-1.6.0
[installed ] [1.6.0 ] http karaf-1.6.0
[uninstalled] [1.6.0 ] war karaf-1.6.0
[uninstalled] [1.6.0 ] webconsole karaf-1.6.0
[installed ] [1.6.0 ] ssh karaf-1.6.0
[installed ] [1.6.0 ] management karaf-1.6.0
But in order to use Blueprint services, I need Spring DM 2.x (according to the Spring website at least, 'For Blueprint Service RI, use the 2.x+version.').
I saw that it is possible to add features to Apache Felix, but from what I understood, this requires to declare a features.xml file on some repository.
My question is, whether there is a simpler way to go, which would also be more integrated (via e.g. Maven)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,经过一番调查,我成功地让这些包与 Karaf 上的 Spring DM 2.0.0.M1 一起使用。
我解决这个问题的方法是添加额外的功能集(请参阅 http ://karaf.apache.org/manual/2.2.5/users-guide/provisioning.html)通过定义一个功能 xml 描述符,如下所示:
加载它
然后通过 Karaf shell 像这样 可以工作,但是带有一些丑陋的堆栈跟踪——我希望在 Karaf 用户列表上的人/Spring 人员的帮助下,我们能够摆脱这些。
Ok, after some investigation I have managed to get the bundles to work with Spring DM 2.0.0.M1 on Karaf.
The way I solved it is to add an additional feature set (see http://karaf.apache.org/manual/2.2.5/users-guide/provisioning.html) by defining a feature xml descriptor like this:
And then to load it like this via the Karaf shell
Note that this works, but comes with a number of ugly stacktraces -- I hope that with the help of the guys on the Karaf users list / the Spring folks we'll be able to get rid of those.