I am trying to get a web service client working from OSGi, I am using Felix as my container.
So far I have tried using Apache CXF. This would not work with my web service as it is RPC/encoded and not supported when I try to generate stubs. I used apache Axis to generate my stubs and now I am running into issues w/ dependencies in my bundles. As my bundles are deployed I get dependencies w/ dependencies of the the apache bundles.
I have am using maven for my builds and have used the maven-bundle-plugin with a bundleall goal to get the dependency bundles, but still run into issues with the bundle dependencies. I would really like to use osgi, as the pluggable nature through bundles is exactly what I need, however I am spending a lot of time chasing down bundle dependencies.
Are there any clear cut examples of cons开发者_JAVA百科uming a SOAP web service from OSGi, including how to resolve the dependencies?
To make your life easier, you might want to try using fuse esb (apache servicemix) or karaf. Felix is a bare minimum OSGi container whereas Karaf is Felix with many of the most important bundles already deployed. Fuse (also called servicemix) is karaf with even more bundles. Fuse comes with cxf so you don't have to mess with it.
If you'd really prefer to use felix, please post your maven bundle plugin configuration as well as a list of your bundles running in felix. I've been using CXF in Felix/Karaf to serve JAX-RS webservices for quite a while and it's a pretty powerful solution.
The bundleall goal for the maven-bundle-plugin will generate bundles for all of your dependencies. However, it will not show you the order you have to install them for the dependencies to resolve. One OSGi implementation that does a great job handling dependencies is the Virgo Web Server from the Eclipse Foundation. With Virgo, you can simply copy all of the bundles generated by bundleall goal directly into the repository/usr folder, put your service into the pickup folder, and the runtime will handle the dependency resolution for you. I have used this process with success in the past.
On a related note, unless you have a few uncommon dependencies, you should look into adding dependencies from the SrpingSource Enterprise Bundle Repository.
精彩评论