IIRC the XmlSeeAlso annotation would point to the ObjectFactory class that is generated for your custom type or wrapper class. It would reference the fully qualified classname of the ObjectFactory that has the methods which create the instances of such types.
I am not where I can grab an example at the moment but when I have seen the annotation on generated artifacts .... say from wsimport when using Metro or Java2WS IN CXF this is what I recall seeing. Mark On Mar 4, 2012 8:42 AM, "mos2" <[email protected]> wrote: > Hi there, > > I am having a problem invoking a JAX-WS web service using the CXF Dynamic > Client. > > To put it short, my web service needs to take a map of paramaters. I may be > wrong here but I believe I can't just provide the HashMap<String, Object> > as > a parameter to the JAX-WS methods, so I created a wrapper class: > > > @XmlRootElement > public class ParamMapWrapper > { > private HashMap<String, Object> paramMap; > > @XmlElement > public HashMap<String, Object> getParamMap() > { > return paramMap; > } > > public void setParamMap(HashMap<String, Object> paramMap) > { > this.paramMap = paramMap; > } > } > > > If I provide this wrapper class as an argument to the invoke method on the > dynamic client, I get the exception output: > > INFO: Exception thrown in ServiceClient: Marshalling Error: class > com.myproject.models.ParamMapWrapper nor any of its super class is known to > this context. > org.apache.cxf.interceptor.Fault: Marshalling Error: class > com.myproject.models.ParamMapWrapper nor any of its super class is known to > this context. > at > > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:261) > at > org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:169) > at > > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:110) > at > > org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) > at > > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) > at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:533) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:463) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:366) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:319) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:339) > at > > com.myproject.servicehandling.ServiceClient.executeTask(ServiceClient.java:73) > at > > com.myproject.servicehandling.TaskHandler.handleNewTask(TaskHandler.java:115) > at > com.myproject.serviceHandling.TaskHandler.run(TaskHandler.java:91) > at java.lang.Thread.run(Thread.java:662) > Caused by: javax.xml.bind.MarshalException > - with linked exception: > [javax.xml.bind.JAXBException: class com.myproject.models.ParamMapWrapper > nor any of its super class is known to this context.] > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:326) > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251) > at > > javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75) > at > > org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.java:552) > at > > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:236) > ... 13 more > Caused by: javax.xml.bind.JAXBException: class > com.myproject.models.ParamMapWrapper nor any of its super class is known to > this context. > at > > com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:247) > at > > com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:262) > at > > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:653) > at > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:156) > at > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBeanInfoImpl.java:131) > at > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBeanInfoImpl.java:333) > at > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:340) > at > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanInfoImpl.java:76) > at > > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494) > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323) > ... 17 more > Caused by: javax.xml.bind.JAXBException: class > com.myproject.models.ParamMapWrapper nor any of its super class is known to > this context. > at > > com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:588) > at > > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:648) > ... 24 more > > Having searched this on Google, I often see a solution to this problem in > the form of adding the @XmlSeeAlso annotation to the referencing class. > Here > however I don't have a referencing class, just the one wrapper class I am > passing to the dynamic client invoke method with it's one HashMap object. > > So can anybody advise me on what I should do to rectify this problem, or > could somebody suggest a better approach to passing my mapped parameters to > the web service? > > Thanks very much, > > Michael > > > > > -- > View this message in context: > http://cxf.547215.n5.nabble.com/Usage-of-XmlSeeAlso-for-javax-xml-bind-JAXBException-xxx-nor-any-of-its-super-class-is-known-to-thist-tp5535238p5535238.html > Sent from the cxf-user mailing list archive at Nabble.com. >
