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.research.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.ISadlServiceProvider")
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.SetServiceNameMap.arg0
at
com.ge.research.sadl.sadlserver.cxf.provider.jaxws_asm.SetServiceNameMap
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.SetServiceNameMap
at
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsE
xception.java:102)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java
:1140)
at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
Any ideas?
Thanks
Barry Hathaway