Servicemix 4、DOSGi 和 Zookeeper [英] Servicemix 4, DOSGi, and Zookeeper

查看:29
本文介绍了Servicemix 4、DOSGi 和 Zookeeper的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是从 fusesource 论坛servicemmix 论坛.

我无法在 FUSE 中使用 DOSGi.我正在尝试将 CXF 的 DOSGi 1.1-SNAPSHOT 与 Zookeeper 发现连接到 FUSE 4.1.0.2.我也在使用 Zookeepr 3.2.1.

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.

在 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 用于动物园管理员发现.然后,当我在一台机器上使用示例服务 impl 启动示例包时,我在 zookeeper 中看到节点创建.然后我在另一台机器上启动示例客户端,并在服务机器上看到输出.效果很好.我确实有一个关于 xml 错误被忽略的警告,因为找不到某些 XSD,但它似乎没有影响任何事情.哦,我还得先安装 OSGi 纲要包.

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.

当我搬到 Fuse 时,我没有这样的运气.OSGi 纲要包随附保险丝,因此无需安装.我应该能够安装 dosgi-ri singlebundle 和 dosgi-ri-discovery 单包,但这不起作用.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 多捆绑包中取出 dsw 捆绑包并安装它.由于 jdom 依赖关系,没有运气.然后我安装了 ri 多捆绑包中的 jdom,它工作正常.然后回到 dsw,然后安装,所以我想我到了某个地方.是时候回去安装 ri-discovery singlebundle 了.当我开始时,我收到一个 pax 日志服务 classcastexception,说它不能转换为 osgi logservice 或其他东西.但这只是一个日志错误,在底部它说它找不到 http 的传输类://schemas.xmlsoap.org/soap/http.好的,所以日志记录被搞砸了,我错过了一些传输类.嗯,很明显,这是因为 ri multibundle 安装的不够多,因为它适用于 felix.所以还有什么是必要的.检查后的 cxf-minimal-bundle 缺少导致最后一个错误的类.所以我安装它.尝试启动发现包,但我最终遇到了某种 corbabroker 异常.哇.谁在所有这些中使用 corba?然后我返回并撤消所有这些并尝试坚持使用 ri 和 ri-discovery 的单捆绑发行版,但只需关闭 servicemix http 服务.这会导致 servicemix 崩溃,我无法重新启动它,因为 cxf jbi 组件最终具有不满意的依赖项.奇怪的.我会忽略它,因为无论如何我都不使用它们,并尝试开始我的示例.无法启动示例,因为它说码头无法启动,因为端口已在使用中.没有意义,因为我已经关闭了 servicemix http 服务.然后我重新启动码头.作品?也许.我的服务已注册,我可以使用 Firefox 浏览到 wsdl,但没有在 zookeeper 中注册.尝试关闭 ri-discovery 包并重新启动它,但我得到一个空指针异常.显然,由于上述错误之一,ri-discovery 从未真正启动.然后我开始尝试拆开 ri-discovery singlebundle 并拉出内部组件.这不起作用,因为它显然是必要的,即使我们内部有一些库我们可以不用.

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.

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

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.

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

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.

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

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.

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

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.

推荐答案

第一点,看 CXF DOSGi mega-bundle 我认为这仅用于在裸 OSGi 运行时中进行快速n-dirty hack,基本上是最小的环境由 Equinox 和 Felix 提供.它不适用于更丰富的环境,如 FUSE 或 Servicemix,因为您可能会与捆绑和平台的服务发生冲突,正如您所看到的.

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.

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

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

使用 Servicemix 控制台,我列出了所有包,并看到以上所有包都处于 Active 状态(如预期).我列出了这些服务,并且 2 个 CXF DOSGi 包正在导出服务,因此看起来工作正常.日志中没有报告错误.

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.

您对 OSGi 有多熟悉?Servicemix 看起来很大,同时学习 OSGi、Servicemix 和 CXF/DOSGi 并不容易(在我看来).

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).

提供的控制台不适合 OSGi 的东西,我建议为 网络界面.

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

这篇关于Servicemix 4、DOSGi 和 Zookeeper的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆