使用 cxf-extension-osgi 重新启动 OSGi 捆绑包
我在 Fuse 4.2 中部署了一个简单的 CXF RS 捆绑包,在初始安装时运行良好。但是,当我更新或重新安装该捆绑包时,REST 服务将无法再访问。
我尝试了各种配置,发现使用 cxf-extension-osgi 是问题...
从这个...
<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml"/>
到这个...
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
另外,我将地址更新为非相对...最终采用此配置(捆绑包重新启动后有效,等等)
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
<jaxrs:server id="testService" address="http://localhost:9000/">
<jaxrs:serviceBeans>
<ref bean="testBean" />
</jaxrs:serviceBeans>
</jaxrs:server>
知道使用 cxf-extension-osgi 时导致此问题的原因吗?另外,使用 cxf-extendsion-http-jetty 时的权衡是什么(功能、性能等)?
谢谢
I have a simple CXF RS bundle deployed in Fuse 4.2 that works fine upon initial installation. But, when I update or re-install the bundle, the REST service in no longer accessible.
I tried a various configurations and found that using cxf-extension-osgi was the issue...
from this...
<import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml"/>
to this...
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
Also, I updated the address to be non-relative...ending up with this configuration (that works after bundle restarts, etc)
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
<jaxrs:server id="testService" address="http://localhost:9000/">
<jaxrs:serviceBeans>
<ref bean="testBean" />
</jaxrs:serviceBeans>
</jaxrs:server>
Any idea what is causing this issue when using cxf-extension-osgi? Also, what is the trade-off when using cxf-extendsion-http-jetty instead (functional, performance, etc)?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
抱歉,cxf/servicemix 集成似乎出现错误。问题是,cxf 尝试在已使用的地址下注册服务(由该服务的旧版本使用)。
捆绑包重新启动/更新后,REST 和 SOAP 服务均无法访问。重新启动整个服务组合。但是,当业务逻辑位于其他bundle中,并且带有SOAP/REST服务的bundle仅包含接口时,仅当接口发生更改时才需要重新启动。
我们与这个错误斗争了很长时间,但不幸的是没有付出任何努力。
Sorry, it seems to be error in cxf/servicemix integration. The problem is, cxf tries to register service under the address that is already used (by older version of this service).
Both REST and SOAP services are unaccessible after bundle restart/update. Restart of whole servicemix. Hovewer, when business logic is in other bundle, and the bundle with SOAP/REST service contains only interface, restart is needed only when interface has changed.
We were fighting with this error long, but unfortunatelly without effort.
我刚刚在 Fuse 4.3.0-fuse-03-00 中对此进行了测试,它似乎工作正常。下面的相关问题也一定解决了我的问题...
https://issues.apache .org/jira/browse/CXF-2947
I just tested this in Fuse 4.3.0-fuse-03-00 and it seems to work fine. The related issue below must have addressed my issue as well...
https://issues.apache.org/jira/browse/CXF-2947