Hi,

I set all inner class with @XmlRootElement annotation. However, it throws
alway an errors. I tried many time during longtime with many different
cases but i can not resolved it.

I hope that you can please help me.

Regards,
Th,



2015-11-24 20:46 GMT+01:00 Andrei Shakirin <[email protected]>:

> Hi,
>
> > -----Original Message-----
> > From: tho huynh ngoc [mailto:[email protected]]
> > Sent: Montag, 23. November 2015 13:22
> > To: [email protected]
> > Subject: Re: send Message object through Jax-ws
> >
> > Hi,
> >
> > I set @XmlRootElement annotation in MyDestination but i give the same
> error
> > at server.
>
> No, error is slightly different this time:
> "myCXF.destination.MyDestination$UDPConnectionInfo"
> Seems that you have inner class UDPConnectionInfo, that isn't annotated,
> unknown in JAXB context and cannot be marshalled.
> Please check that all classes you send in the message are marshallable for
> JAXB.
>
> Regards,
> Andrei
>
> >
> >
> > The error at client side :
> > Caused by: org.apache.cxf.binding.soap.SoapFault: Marshalling Error:
> class
> > myCXF .destination.MyDestination$UDPConnectionInfo nor any of its super
> > class is known  to this context.
> >     at
> >
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFa
> > ult(Soap11FaultInInterceptor.java:86)
> >     at
> >
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessa
> > ge(Soap11FaultInInterceptor.java:52)
> >     at
> >
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessa
> > ge(Soap11FaultInInterceptor.java:41)
> >     at
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> > n
> > .java:307)
> >     at
> >
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(Abs
> > tractFaultChainInitiatorObserver.java:113)
> >     at
> >
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(
> > CheckFaultInterceptor.java:69)
> >     at
> >
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(
> > CheckFaultInterceptor.java:34)
> >     at
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChai
> > n
> > .java:307)
> >     at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:802)
> >     at org.apache.cxf.transport.udp.UDPConduit$2.run(UDPConduit.java:112)
> >     at
> > org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQu
> > eueImpl
> > .java:428)
> >     at
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1
> > 1
> > 42)
> >     at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
> > 6
> > 17)
> >     at
> > org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.r
> > un(Autom
> > aticWorkQueueImpl.java:353)
> >     at java.lang.Thread.run(Thread.java:745)
> >
> > Thank you for your help,
> >
> > 2015-11-22 16:53 GMT+01:00 Andrei Shakirin <[email protected]>:
> >
> > > 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.j
> > > > ava:2
> > > > 66)
> > > >     at
> > > org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:237)
> > > >     at
> > > >
> > > org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writePart
> > > s(Abst
> > > > ractOutDatabindingInterceptor.java:122)
> > > >     at
> > > >
> > > org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(Bare
> > > OutI
> > > > nt
> > > > erceptor.java:69)
> > > >     at
> > > >
> > > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> > > rChai
> > > > n
> > > > .java:307)
> > > >     at
> > > >
> > > org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(Outg
> > > oing
> > > > Ch
> > > > ainInterceptor.java:83)
> > > >     at
> > > >
> > > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIntercepto
> > > rChai
> > > > n
> > > > .java:307)
> > > >     at
> > > >
> > > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitia
> > > tionOb
> > > > server.java:121)
> > > >     at
> > > >
> > > org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractH
> > > TTPDes
> > > > tination.java:251)
> > > >     at
> > > >
> > > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(Jet
> > > tyHTTP
> > > > Destination.java:261)
> > > >     at
> > > >
> > > org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPH
> > > andler
> > > > .java:70)
> > > >     at
> > > >
> > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandle
> > > r.java
> > > > :1088)
> > > >     at
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:
> > > > 1024)
> > > >     at
> > > >
> > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.ja
> > > va:135
> > > > )
> > > >     at
> > > >
> > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(Conte
> > > xtHand
> > > > 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(Abstract
> > > HttpCo
> > > > nnection.java:494)
> > > >     at
> > > >
> > > org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpCo
> > > nnecti
> > > > 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(AsyncHttpConnectio
> > > n.java
> > > > :82)
> > > >     at
> > > >
> > >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.
> > > > java:696)
> > > >     at
> > > >
> > > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndP
> > > oint.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(AbstractMarshall
> > > erImp
> > > > l
> > > > .java:95)
> > > >     at
> > > > org.apache.cxf.jaxb.JAXBEncoderDecoder.writeObject(JAXBEncoderDecode
> > > > r.jav
> > > > a:6
> > > > 17)
> > > >     at
> > > > org.apache.cxf.jaxb.JAXBEncoderDecoder.marshall(JAXBEncoderDecoder.j
> > > > ava: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.ja
> > > va:247
> > > > )
> > > >     at
> > > >
> > > com.sun.xml.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.ja
> > > va:262
> > > > )
> > > >     at
> > > >
> > >
> >
> com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:
> > > > 653)
> > > >     at
> > > >
> > > com.sun.xml.bind.v2.runtime.property.SingleMapNodeProperty.serializeBo
> > > dy(Si
> > > > n
> > > > gleMapNodeProperty.java:277)
> > > >     at
> > > >
> > > com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanI
> > > nfoIm
> > > > 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(Elem
> > > > entBe
> > > > anI
> > > > nfoImpl.java:155)
> > > >     at
> > > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$1.serializeBody(Elem
> > > > entBe
> > > > anI
> > > > nfoImpl.java:130)
> > > >     at
> > > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeBody(Elemen
> > > > tBean
> > > > Inf
> > > > oImpl.java:332)
> > > >     at
> > > >
> > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementB
> > > eanI
> > > > nf
> > > > oImpl.java:339)
> > > >     at
> > > >
> > > com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl.serializeRoot(ElementB
> > > eanI
> > > > nf
> > > > oImpl.java:75)
> > > >     at
> > > >
> > > com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.ja
> > > va: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(JAXBContextImp
> > > l.ja
> > > > va
> > > > :582)
> > > >     at
> > > >
> > >
> >
> com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:
> > > > 648)
> > > >     ... 41 more
> > > >
> > > > Anyone helps me, please ?
> > > > Regards,
> > >
>

Reply via email to