Servicemix 4、DOSGi 和 Zookeeper

发布于 2024-08-06 02:07:16 字数 3633 浏览 14 评论 0 原文

这是从 fusesource 论坛servicemmix 论坛

我无法让 DOSGi 在 FUSE 中工作。我正在尝试将带有 Zookeeper 发现的 CXF 的 DOSGi 1.1-SNAPSHOT 获取到 FUSE 4.1.0.2 上。我也在使用 Zookeepr 3.2.1。

一切在 Felix 2.0.0 上都能完美运行。我只需按照 DOSGi Discovery 页面上的说明进行操作,然后安装 发现演示 捆绑包。对于 DOSGi,我只使用 cxf-dosgi-ri-singlebundle-distribution-1.1-SNAPSHOT.jar 用于 DSW 和 cxf-dosgi-ri-discovery-singlebundle-distribution-1.1-SNAPSHOT.jar 用于 Zookeepr 发现。然后,当我在一台计算机上启动带有示例服务实现的示例包时,我在 Zookeeper 中看到节点创建。然后,我在另一台计算机上启动示例客户端,并在服务计算机上看到输出。效果很好。我确实收到了有关 xml 错误被忽略的警告,因为无法找到某些 XSD,但它似乎不会影响任何内容。哦,我还必须先安装 OSGi compendium 包。

当我搬到 Fuse 时,我就没有这样的运气了。 OSGi 纲要包附带了保险丝,因此无需安装。我应该能够安装 dosgi-ri singlebundle 和 dosgi-ri-discovery singlebundle,但这不起作用。 dosgi-ri singlebundle 具有各种与 servicemix 重叠的捆绑包。我收到有关端口 8081 的错误?或者无论 osgi.http.service 参数是什么,已经在使用中。显然,dosgi-ri singlebundle 附带了 pax webservice,它读取与 servicemix 附带的 servicemix http 服务包相同的属性。那就是当我切换到 cxf-dosgi-ri-multibundle-distribution-1.1-SNAPSHOT.zip 并将其解压缩以获取我想要的部分。我从 dosgi-ri multibundle 中取出 dsw 包并安装它。由于 jdom 依赖,运气不佳。然后我安装了 ri multibundle 中的 jdom,它工作得很好。然后返回 dsw,然后安装,所以我想我已经有所进展。是时候回去安装 ri-discovery singlebundle 了。当我开始时,我收到一个 pax 日志服务类广播异常,说它不能转换为 osgi 日志服务或其他东西。但这只是一个日志错误,在底部它说找不到 http 的传输类: //schemas.xmlsoap.org/soap/http。好吧,日志记录搞砸了,我错过了一些传输类。嗯,很明显,这是因为没有从 ri 多捆绑包中安装足够的文件,因为它可以在 felix 上运行。那么还有什么是必要的呢。经检查,cxf-minimal-bundle 缺少类,导致最后一个错误。所以我安装了它。尝试启动发现包,但我最终遇到了某种 corbabroker 异常。 Wtf。谁在这一切中使用了 corba?然后我返回并撤消所有这些,并尝试坚持使用 ri 和 ri-discovery 的单捆绑发行版,但只需关闭 servicemix http 服务。这会导致 servicemix 崩溃,并且我无法重新启动它,因为 cxf jbi 组件最终会出现不满足的依赖关系。奇怪的。我会忽略它,因为我无论如何也不使用它们,并尝试开始我的示例。无法启动示例,因为它说码头无法启动,因为端口已在使用中。没有意义,因为我已经关闭了 servicemix http 服务。然后我重新启动码头。作品?或许。我的服务已注册,我可以使用 Firefox 浏览到 wsdl,但在 Zookeeper 中没有注册。尝试关闭 ri-discovery 捆绑包并重新启动它,但我得到了一个空指针异常。显然,由于上述错误之一,ri 发现从未真正启动。然后我开始尝试拆开 ri-discovery 单包并取出内部结构。这不起作用,因为它显然是必要的,尽管里面有一些我们可以不需要的库。

故事结束。无法让它发挥作用。其他人可以让它工作吗?我只想在 SMX4 中运行发现示例。我很确定这只是捆绑冲突问题。这不是 OSGi 应该修复的吗???这比仅仅告诉我你依赖哪些 jar 并让我设置我的类路径更糟糕。至少这样我最终会让事情运行起来。

我认为,我的下一步将是再次尝试使用 ri-multibundle,仅使用 dsw 和 jdom,再加上 ri-discovery singlebundle。然后我将尝试一些 cxf-fuse 捆绑包或一些 cxf-rt 捆绑包来解决肥皂传输问题。

编辑说明:我需要的不仅仅是显示处于活动状态的 DOSGi 包。在您尝试通过它们公开服务之前,它们实际上不会做太多事情。我确实需要看到多台机器向 Zookeeper 实例注册服务以及使用这些服务的其他机器——就像正在运行的 DOSGi Discovery Sample 一样。

我已经能够通过使用提到的最小 cxf 捆绑包,通过删除部分原始 cxf 捆绑包并重新启动 jetty 服务,然后启动示例服务,让 cxf 将分布式服务示例公开为 SOAP Web 服务...或者通过安装cxf最小捆绑包,然后启动我的服务,然后立即卸载cxf最小捆绑包,然后重新启动jetty......我认为这就是顺序。这些都无法从干净的启动中工作,并且必须重新启动服务作为让 DOSGi 工作的过程是很糟糕的。我什至不知道为什么安装然后卸载会做任何事情——它不应该留下任何工件。

This is cross posted from the fusesource forum and the servicemmix forum.

I can't get DOSGi working in FUSE. I'm trying to get CXF's DOSGi 1.1-SNAPSHOT with Zookeeper discovery onto FUSE 4.1.0.2. I'm also using Zookeepr 3.2.1.

Everything works perfectly on Felix 2.0.0. I just follow the instructions on the DOSGi Discovery page and then install the Discovery Demo bundles. For DOSGi, I just use the cxf-dosgi-ri-singlebundle-distribution-1.1-SNAPSHOT.jar for DSW and cxf-dosgi-ri-discovery-singlebundle-distribution-1.1-SNAPSHOT.jar for zookeepr discovery. Then when I start the sample bundles with the sample service impl on one machine, I see the node creation in zookeeper. Then I start the sample client on another machine and I see the output on the service machine. Works great. I do have an warning about an xml error being ignored because some XSD coudln't be found, but it doesn't seem to affect anything. Oh, I also have to install the OSGi compendium bundle first.

When I move to Fuse, I have no such luck. The OSGi compendium bundle comes with fuse, so no need to install that. I should just be able to install the dosgi-ri singlebundle, and the dosgi-ri-discovery single bundle, but that doesn't work. The dosgi-ri singlebundle has all kinds of overlapping bundles with servicemix. I get an error about port 8081? or whatever the osgi.http.service parameter is, being already in use. Apparently the dosgi-ri singlebundle comes with pax webservice, which reads the same property as the servicemix http service bundle that comes with servicemix. Thats when I switch to the cxf-dosgi-ri-multibundle-distribution-1.1-SNAPSHOT.zip and unzip it to take the parts I want. I take the dsw bundle out of the dosgi-ri multibundle and install that. No luck because of the jdom dependency. Then I install the jdom that comes in the ri multibundle, which works fine. Then go back to dsw, and that installs, so I think i'm getting somewhere. Time to go back and install the ri-discovery singlebundle. When I start that I get a pax logging service classcastexception saying it can't be cast to a osgi logservice or something. But thats just a logging error, and at the bottom it says it can't find the transport class for http://schemas.xmlsoap.org/soap/http. Ok, so logging is screwed up and I'm missing some transport class. Well, clearly this comes from not installing enough from the ri multibundle because it worked on felix. So what else in there is necessary. The cxf-minimal-bundle upon inspection has the missing class causing that last error. So I install that. Try to start the discovery bundle, but I end up with some kind of corbabroker exception. Wtf. Whose using corba in all of this? Then I go back and undo all of that and try to stick with the singlebundle distros of ri and ri-discovery, but just turn off the servicemix http service. That crashes servicemix and I can't restart it becauuse the cxf jbi components end up with an unsatisfied dependency. Odd. I'll just ignore that because I don't use those anyway, and try to start my samples. Can't start the samples because it says jetty can't start because the ports already in use. Doesn't make sense because I shutdown the servicemix http service already. Then I restart jetty. Works? Maybe. My service gets registered and I can browse to the wsdl using firefox, but no registration in zookeeper. Try to shutdown the ri-discovery bundle and restart it, but I get a nullpointerexception. Appparently the ri-discovery never actually started up due to one of the aforementioned errors. Then I started trying to take apart the ri-discovery singlebundle and pull out the internals. That didn't work because its all apparently necessary, even though theres some libs inside we could do without.

End of the story. Can't get it to work. Can anybody else get it to work? I just want to run the discovery samples in SMX4. I'm pretty sure its just a bundle conflict problem. Isn't this what OSGi is supposed to fix??? This is worse than just telling me what jars you depend on and making me setup my classpath. At least then I'd eventually get the thing running.

My next steps, I think, will be to try again with the ri-multibundle, just the dsw and jdom, plus the ri-discovery singlebundle. Then I'll try some of the cxf-fuse bundles or some of the cxf-rt bundles to get around the soap transport issue.

Edit notes: I need more than just showing the DOSGi bundles in an Active state. They don't actually do much until you try to expose a service through them. I do need to see multiple machines registering services with a zookeeper instance and other machines consuming those services -- just like the running DOSGi Discovery Sample.

I've been able to get cxf to expose the distributed service sample as a soap webservice by using the minimal cxf bundle mentioned by either removing parts of the original cxf bundles and restarting the jetty service, and then starting the sample service... or by installing the cxf minimal buundle, then starting my service, then immediately uninstalling the cxf minimal bundle, then restarting jetty... I think that was the order. Neither of these will work from a clean startup, and having to restart services as a procedure to get DOSGi working is just bad. I don't even know why installing then uninstalling would do anything -- it shouldn't be leaving any artifacts around.

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

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

发布评论

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

评论(1

相守太难 2024-08-13 02:07:16

首先,看看 CXF DOSGi mega-bundle,我认为这仅适用于裸 OSGi 运行时中的快速黑客攻击,基本上是 Equinox 和 Felix 提供的最小环境。它不适用于 FUSE 或 Servicemix 等更丰富的环境,因为您可能会与捆绑包和平台的服务发生冲突,正如您所看到的那样。

我能够让 Servicemix 4.0 干净地启动(这是在 Windows 上),然后进行热部署:

  • com.springsource.org.jdom-1.0.0.jar
  • cxf-bundle-minimal-2.2.1.jar
  • cxf-dosgi -ri-discovery-local-1.0.jar
  • cxf.dosgi-ri-dws.cxf-1.0.jar

使用 Servicemix 控制台,我列出了所有捆绑包,并发现上述所有捆绑包都处于 Active 状态(如预期)。我列出了服务,2 个 CXF DOSGi 捆绑包正在导出服务,因此看起来工作正常。日志中没有报告任何错误。

您对 OSGi 有多熟悉? Servicemix 看起来相当大,一起学习 OSGi、Servicemix 和 CXF/DOSGi 并不容易(在我看来)。

提供的控制台不太适合 OSGi 的东西,我建议安装 Apache Felix 控制台捆绑包以用于 网络界面

First point, looking at the CXF DOSGi mega-bundle I think this is only for quick-n-dirty hacking in a bare OSGi runtime, basically the minimal environment provided by Equinox and Felix. It will not be intended for richer environments like FUSE or Servicemix as you will likely clash on services from the bundle and the platform, as you appear to have seen.

I was able to get Servicemix 4.0 to start cleanly (this is on Windows) and then I hot-deployed:

  • com.springsource.org.jdom-1.0.0.jar
  • cxf-bundle-minimal-2.2.1.jar
  • cxf-dosgi-ri-discovery-local-1.0.jar
  • cxf.dosgi-ri-dws.cxf-1.0.jar

Using the Servicemix console I listed all bundles and saw that all of the above were in the Active state (as expected). I listed the services and the 2 CXF DOSGi bundles were exporting services, so that appeared to have worked correctly. No errors were reported in the log.

How familiar are you with OSGi? Servicemix looks quite large and learning OSGi, Servicemix and CXF/DOSGi together isn't going to be easy (in my opinion).

The supplied console isn't great for the OSGi stuff and I'd suggest installing the Apache Felix console bundles for a web interface.

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