Hi, It seems that your myCXF.MyDestination.class is unknown in JAXB context and cannot be marshalled. Either the class has no JAXB annotations or it is declared as Object from another class. Please check if MyDestination.class has @XmlRootElement annotation.
Regards, Andrei. > -----Original Message----- > From: tho huynh ngoc [mailto:[email protected]] > Sent: Mittwoch, 18. November 2015 15:20 > To: [email protected] > Subject: send Message object through Jax-ws > > Hi, > > I tried to send a org.apache.cxf.message.Message object through Jax-Ws cxf. > > I received an error: > > WARNING: Interceptor for > {destination}HelloWorldService#{destination}getMessage > has thrown exception, unwinding now > org.apache.cxf.interceptor.Fault: Marshalling Error: class myCXF.MyDestination > n or any of its super class is known to this context. > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:2 > 66) > at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:237) > at > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(Abst > ractOutDatabindingInterceptor.java:122) > at > org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutI > nt > erceptor.java:69) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai > n > .java:307) > at > org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(Outgoing > Ch > ainInterceptor.java:83) > at > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai > n > .java:307) > at > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationOb > server.java:121) > at > org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDes > tination.java:251) > at > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTP > Destination.java:261) > at > org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler > .java:70) > at > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java > :1088) > at > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java: > 1024) > at > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135 > ) > at > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHand > lerCollection.java:255) > at > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java: > 1 > 16) > at org.eclipse.jetty.server.Server.handle(Server.java:370) > at > org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpCo > nnection.java:494) > at > org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnecti > on.java:982) > at > org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(Abstr > actHttpConnection.java:1043) > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) > at > org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java > :82) > at > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint. > java:696) > at > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.j > ava:53) > at > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java: > 608) > at > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java: > 5 > 43) > at java.lang.Thread.run(Thread.java:745) > Caused by: javax.xml.bind.MarshalException > - with linked exception: > [com.sun.istack.SAXException2: class myCXF.MyDestination nor any of its super > cl ass is known to this context. > javax.xml.bind.JAXBException: class myCXF.MyDestination nor any of its super > cla ss 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(AbstractMarshallerImp > l > .java:95) > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecoder.jav > a:6 > 17) > at > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.java:2 > 41) > ... 27 more > Caused by: com.sun.istack.SAXException2: class myCXF.MyDestination nor any > of it s super class is known to this context. > javax.xml.bind.JAXBException: class myCXF.MyDestination nor any of its super > cla ss 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.property.SingleMapNodeProperty.serializeBody(Si > n > gleMapNodeProperty.java:277) > at > com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoIm > p > l.java:360) > at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java: > 696) > at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBe > anI > nfoImpl.java:155) > at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(ElementBe > anI > nfoImpl.java:130) > at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(ElementBean > Inf > oImpl.java:332) > at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanI > nf > oImpl.java:339) > at > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementBeanI > nf > oImpl.java:75) > at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494 > ) > at > com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323) > ... 31 more > Caused by: javax.xml.bind.JAXBException: class myCXF.MyDestination nor any > of it s super class is known to this context. > at > com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.ja > va > :582) > at > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java: > 648) > ... 41 more > > Anyone helps me, please ? > Regards,
