I'm using WebClient to do some negative tests... As in, I want to be sure I
get back a 404 from one of my services, when I give it something that can't be
found (and so on). This code:
String uri = getDefectRelativeUri(id);
WebClient client = WebClient.create(Config.BASE_URI);
Response res = client.path(uri).get();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), res.getStatus());
seems to produce the attached output. Note that in this case, what I'm
fetching is something that does cause the server to send back a 404. So, it
seems oddly coincidental that I'm expecting a NOT_FOUND, and am getting (at the
core) an IOException with message "Not Found". :-)
Anyway, the test runs to completion, and succeeds... The IOException is
swallowed (somewhere), but is sent to the log file anyway. Is this to be
expected, or have I got a verbose setting (or similar) turned on somewhere
that's making CXF talk to me more than it might normally?
I don't have log4j configured, but still wouldn't expect to see this kind of a
thing emitted since it seems more like an implementation detail than something
that's genuinely worth logging. Makes my Hudson runs look awfully chatty. :-)
Thanks.
Nov 20, 2009 1:08:28 PM org.apache.cxf.bus.spring.BusApplicationContext
getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
[Deprecated] Xalan: org.apache.xml.resolver.CatalogManager
Nov 20, 2009 1:08:30 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:529)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:510)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:203)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:229)
at
...
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 29 more
Nov 20, 2009 1:08:30 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at
org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:529)
at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:510)
at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:203)
at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:229)
...
Caused by: java.io.IOException: Not Found
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2071)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947)
at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
... 29 more