I added those couple of lines and got the same result.
Could part of the problem be that the stack trace is referring to
com.sun.xml.bind.v2.runtime.*
and not javax.*?
On 8/23/2011 1:44 PM, Daniel Kulp wrote:
The most common cause of this is to import the javax.jws annotations from a
different place than where CXF is importing them from. You may want to try
updating your bundle's manifest to use a version like:
javax.jws*;version="[1.0,3)",
javax.xml.ws*;version="[1.0,3)",
etc... to make sure you get the versioned kind and not the versions exported
from the JRE. Likewise for jaxb and similar.
Dan
On Tuesday, August 23, 2011 11:33:06 AM Barry Hathaway wrote:
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.ISadlService
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.SetServiceNameMap.arg
0 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(Illega
lAnnotationsE xception.java:102)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.j
ava:472) at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
at
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBCon
textImpl.java
:1140)
at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
Any ideas?
Thanks
Barry Hathaway