I'm trying to use Apache CXF in an Eclipse RCP application. One plugin (X) would provide an OSGI service which uses CXF. Another plugin (Y) would call this service.
The "X" plugin uses the CXF JAR's I downloaded (CXF 2.7.11) which I added to the MANIFEST.MF. When I run my test cases from withint plugin X everything goes fine i.e. I can call a webservice and get a response.
When I try to run plugin "Y" it sees the OSGI service which I can call. The OSGI service calls the same code from withint project "X" as in the above case, but now it doesnt work. The exception I get is:
com.sun.xml.internal.ws.client.sei.SEIStub cannot be cast to org.apache.cxf.frontend.ClientProxy
in this part:
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(myServicePort);
Now when I run the SAME CODE within this plugin (plugin X) it just runs fine.
So I suspect it has something to do with the JAR's and dependencies etc. but Im not sure. I searched for this exception and this comes up when some JAR's are missing from CXF, but added ALL JAR's to the MANIFEST.MF I found in the CXF distribution.
I'm not even sure what classes of CXF I really need, but the test cases seem to run just fine.
Any ideas what went wrong?