在 ServiceMix/FUSE 4.3 中部署多个 RESTful 服务包

发布于 2024-10-09 04:22:31 字数 781 浏览 6 评论 0原文

我使用 apache-servicemix-4.3.0-fuse-03-00.tar.gz 附带的示例 cxf-jaxrs 来研究如何部署提供不同 RESTful 服务的多个包。我所做的是将 cxf-jaxrs 示例复制到 cxf-jaxrs-example-1 中,并修改 pom.xml 和 beans.xml。修改是:

1. pom.xml
version: 4.3.0-2-fuse-03-00
name: Apache ServiceMix Example 2:: CXF JAX-RS OSGI
2. beans.xml
<jaxrs:server id="customerService2" address="/crm2"> 

然后我做了两个包。一个是原始示例包cxf-jaxrs-4.3.0-fuse-03-00.jar,另一个是修改后的cxf-jaxrs-4.3.0-2-fuse-03-00.jar,我复制了它们进入“部署”目录。

servicemix 启动后,我看到两个捆绑包都处于活动状态并成功启动。

但是,我只能访问一个捆绑包中的 RESTful 服务。当我输入“http://localhost:8080/cxf/crm2/customerservice/customers/123”时,我得到“未找到服务”。错误。当我停止另一个示例包(原始包)时,我可以毫无问题地访问“http://localhost:8080/cxf/crm2/customerservice/customers/123”。

我做错了什么??它应该在上下文路径“/crm”和“/crm2”中提供 RESTful 服务。

I am using the example cxf-jaxrs shipped with apache-servicemix-4.3.0-fuse-03-00.tar.gz to investigate how to deploy multiple bundles which provides different RESTful services. What I did is copied the cxf-jaxrs example into cxf-jaxrs-example-1, and modified the pom.xml and beans.xml. The modifications are :

1. pom.xml
version: 4.3.0-2-fuse-03-00
name: Apache ServiceMix Example 2:: CXF JAX-RS OSGI
2. beans.xml
<jaxrs:server id="customerService2" address="/crm2"> 

Then I made two packages. The one is the original example package cxf-jaxrs-4.3.0-fuse-03-00.jar and the other is the modified one cxf-jaxrs-4.3.0-2-fuse-03-00.jar and I copied them into "deploy" directory.

After servicemix started, I see both bundles are active and started succesfully.

But, I am only able to access the RESTful services in one bundle. When I type "http://localhost:8080/cxf/crm2/customerservice/customers/123", I got "No service was found." error. And when I stop the other example bundle(the original one), I can access "http://localhost:8080/cxf/crm2/customerservice/customers/123" with no problems.

What I did wrong?? It is supposed to provides the RESTful services in both context path "/crm" and "/crm2".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘虞初梦 2024-10-16 04:22:31

问题解决了。我的不好。我忘记修改 CustomerService 类上的路径注释

problem sovled. My bad. I forgot to modify the path annotation on CustomerService class

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文