Hi Andy
> hello after long absence ;)
good to hear from you again :-)
Just yesterday I updated the client code for it not to lose the exception
caught during AbstractClient readBody/writeBody. I've obviously been guilty
of writing the code which swallows exceptions (hopefully non of that is left
now).
So as far as the NPE is concerned, it's coming from the JAXB layer, which is
then rethrown by JAXBElementProvider, right ?
or is NPE originating from JAXBElementProvider.unmarshalFromReader() ?
This function is called if an XMLStreamReader has been found on a message...
More information is needed, perhaps you can post a sample JaxbEnrichedObject
class ? Or some test case ?
cheers, Sergey
amichalec wrote:
>
> Hi guys and hello after long absence ;)
>
> it's late night in my place so it my be source of my problem but I stuck
> for good early this evening and I see no other way than ask for hints ;)
>
> I have working JAXRS service returning properly XML resource (to web
> browser) being marshalled JAXB-enriched POJO. Since I want to automate a
> bit testing of server side, I jumped to WebClient and tried to unmarshal
> transported data to the same POJO:
>
> WebClient wc = WebClient.create("http://localhost:8080");
>
> wc.path("properly/set/path").accept(MediaType.APPLICATION_XML_TYPE);
> JaxbEnrichedObject obj = wc.get(JaxbEnrichedObject.class);
>
> where "JaxbEnrichedObject" is class used on server side.
> To my surprise it failed even though it was almost taken straight from cxf
> test cases. Result was more or less like this:
>
> Exception in thread "main" javax.ws.rs.WebApplicationException:
> javax.ws.rs.WebApplicationException
> at
> org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:550)
> at
> org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:536)
> at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:510)
> at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:286)
> at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:314)
> at ...
> Caused by: javax.ws.rs.WebApplicationException
> at
> org.apache.cxf.jaxrs.client.AbstractClient.readBody(AbstractClient.java:404)
> at
> org.apache.cxf.jaxrs.client.WebClient.handleResponse(WebClient.java:544)
> ... 5 more
>
> Debugging session revealed that NPE occurs meanwhile but is swallowed
> during exception rethrowing -- NPE pops up in
> JAXBElementProvider.unmarshalFromReader() when JAXB unmarshaller is called
> for input stream. I do not think debugging JAXB help me answer my
> question... so what am I missing here?
>
> cheers,
> andy.
>
--
View this message in context:
http://www.nabble.com/WebClient-fails-to-unmarshall-tp25337879p25342860.html
Sent from the cxf-user mailing list archive at Nabble.com.