开发者

How to make Axis2 run in an OSGi environment?

开发者 https://www.devze.com 2023-03-05 23:45 出处:网络
I need to access an webservice in an OSGi-Environment (Equinox). I do already have the code for using the webservice as a stand-alone application.

I need to access an webservice in an OSGi-Environment (Equinox). I do already have the code for using the webservice as a stand-alone application.

The sample code uses Axis2 this seems t开发者_如何学Pythono be a problem as I need to add all required libraries as separate bundles. This does not work with Axis2 because the jar files provided by the project are not prepared for OSGi.

I tried to "bundelize" the JAR files via BND but in the end the bundles do not work because of a "Package uses conflict error: org.apache.axis2.addressing"

How to I make Axis2 OSGi-aware?

Alternatively - what is a simple and fool-proof variant for accessing a (soap) webservice in Equinox (plain not Eclipse)? I already tried Apache CXF which failed because it looks like it tries to generate code at runtime and Axis2 is also very difficult as my post shows.


You should consider to embed the Axis2 libraries (and dependencies) into your bundle. In this case Axis2 will not be deployed as own bundle - instead the classes/jars will be copied to into your bundle.

If you are using maven to build your bundle you should have a look at the maven-bundle-plugin and the Embedding dependencies section.


I also would recommend to have a closer look if no OSGi enabled Axis2 libraries are around (I do not use it, so I don't know it but a quick search results in org.apache.axis2.osgi).

0

精彩评论

暂无评论...
验证码 换一张
取 消