Hi,

It SHOULD work, we have a testcase in Apache SMX code which demonstrate cxf JAX-WS handlers works in OSGi container, you may need take a look.

Here's a bundle[1] which include the jax-ws handler client and server(it deploy the jaxws handler service endpoint and also export client proxy as OSGi service), here's the testcase[2]which hold client OSGi service and invoke the jaxws handler service endpoint, the testSoapHandlerOsgi method.

[1]https://svn.apache.org/repos/asf/servicemix/smx4/features/trunk/itests/cxf-soap-handler-osgi/
[2]https://svn.apache.org/repos/asf/servicemix/smx4/features/trunk/itests/tests/src/test/java/org/apache/servicemix/examples/IntegrationTest.java

Freeman

On 2012-3-29, at 下午9:47, Isuru Suriarachchi wrote:

I'm trying CXF in my OSGi container and looks like JAX-WS handler samples
are not working inside OSGi. When I had a look at the code in
the HandlerChainBuilder class, it uses clz.getResource(filename) to load
the handler file. This fails in OSGi.

protected URL resolveHandlerChainFile(Class clz, String filename) {
       URL handlerFile = clz.getResource(filename);
       if (handlerFile == null) {
           //the file location might be an absolute java.net.URL in
externalForm.
           try {
               handlerFile = new URL(filename);
               //test if the URL can be opened
               handlerFile.openStream();
           } catch (Exception e) {
               //do nothing
           }
       }
       return handlerFile;
   }

Has anyone tried this before? Is there a workaround for this problem?

Thanks,
~Isuru

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com









Reply via email to