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-tp25337879p25337879.html
Sent from the cxf-user mailing list archive at Nabble.com.