Hi Yes, it is HttpConduit which logs and throws IO exceptions in some cases (which probably makes perfect sense for SOAP) but the JAX-RS client runtime catches it so that the WEB client can check the Response status and decide what to do. I think that proxies will actually have this exception propagated unless a Response is explicitly expected.
What I will do is I will add a message property in the WEB client code for HTTP conduit not to log these exceptions... Sergey -----Original Message----- From: John Klassa [mailto:[email protected]] Sent: 20 November 2009 18:21 To: [email protected] Subject: log file noise... is this normal? 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$MessageSenderEndingI nterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC hain.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$MessageSenderEndingI nterceptor.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$MessageSenderEndingI nterceptor.handleMessage(MessageSenderInterceptor.java:64) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC hain.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.handleResp onseInternal(HTTPConduit.java:2071) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp onse(HTTPConduit.java:2022) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTP Conduit.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$MessageSenderEndingI nterceptor.handleMessage(MessageSenderInterceptor.java:62) ... 29 more
