I am currently facing some problems using a jaxrs:client in blueprint.

The first problem is that org.apache.cxf.jaxrs.client.Client is not found at runtime.
I had to add this to the maven bundle plugin to make it work:
                        <Import-Package>
                            org.apache.cxf.jaxrs.client,
                            *
                        </Import-Package>

As far as I know this should not be necessary. So this might be a bug in the cxf blueprint support.

The next and more severe problem is that my service interface is not found:
Caused by: java.lang.IllegalArgumentException: interface net.lr.tutorial.karaf.cxf.personservice.person.PersonService is not visible from class loader

It looks like the JAXRS client factory does not use the classloader of my bundle. My bundle correctly imports the package so it should be visible.

You can easily recreate error using my Karaf cxf tutorial:
Checkout the project https://github.com/cschneider/Karaf-Tutorial

The project you need is at: cxf/personservice
Run mvn clean install there.

Then start karaf 2.3.2 and execute the following commands:
features:chooseurl cxf 2.7.5
features:install http cxf
install -s mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT install -s mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-server/1.0-SNAPSHOT install -s mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-proxy-rest/1.0-SNAPSHOT

The proxy bundle will be in blueprint status failed and the stacktrace will look like this:
https://gist.github.com/cschneider/6156833

Is there anything I am doing wrong or is this really a CXF bug?

Christian

--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Reply via email to