I thought I had figured out how to exclude web service methods.
In my interface file I specified:
@WebService(name="SadlService",targetNamespace="http://sadlserver.sadl
.resea rch.ge.com") public interface ISadlServiceProvider {
In this file I specified a @WebMethod annotation on all the
methods
with
the exception of
getServiceNameMap() and setServiceNameMap(Map<String,String[]>
serviceNameMap).
In the implementation file I specified:
@WebService(serviceName="SadlService",name="SadlService",
targetNamespace="http://sadlserver.sadl.research.ge.com",
endpointInterface
="com.ge.research.sadl.sadlserver.cxf.provider.ISadlS
ervice Provider") public class SadlServiceProvider implements
ISadlServiceProvider {
In this file I used no annotations with the exception of:
@WebMethod(exclude=true)
public Map<String,String[]> getServiceNameMap() {
and
@WebMethod(exclude=true)
public void setServiceNameMap(Map<String,String[]>
serviceNameMap) {>>
Both will get called by Spring during bean creation. That is why I
don't
expose them.
Well this worked just fine when running CXF under Tomcat.
Now I tried to port this service to a OSGi (ServiceMix)
environment.
When I start the bundle
it complains about those 2 excluded methods:
Caused by:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2
counts of IllegalAnnotationExceptions
java.util.Map is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.util.Map
at private java.util.Map
com
.ge
.research.sadl.sadlserver.cxf.provider.jaxws_asm.SetServiceNameM
ap.arg 0 at
com
.ge
.research.sadl.sadlserver.cxf.provider.jaxws_asm.SetServiceNameM
ap
java.util.Map does not have a no-arg default constructor.
this problem is related to the following location:
at java.util.Map
at private java.util.Map
com.ge.research.sadl.sadlserver.cxf.provider.jaxws_asm.SetS
erviceNameMap.arg0
at
com
.ge
.research.sadl.sadlserver.cxf.provider.jaxws_asm.SetServiceNameM
ap
at
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException
$Builder.check(
Illega lAnnotationsE xception.java:102)
at
com
.sun
.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContext
Impl.j ava:472) at
com
.sun
.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.jav
a:302) at
com.sun.xml.bind.v2.runtime.JAXBContextImpl
$JAXBContextBuilder.build(J
AXBCon textImpl.java
:1140)
:
at
com
.sun
.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:1
54)
Any ideas?
Thanks
Barry Hathaway