cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Capturing CXF Exceptions
Date Mon, 07 Feb 2011 16:35:08 GMT
On Sunday 06 February 2011 11:36:55 am Sergey Beryozkin wrote:
> I believe using CXF interceptors has always been possible, alternatively,
> registering a custom JAX-RS RuntimeException ExceptionMapper is a
> possibility.
> 
> The only thing I'm not sure about is why the uncaught exception is not
> propagated to the servlet container, it's definitely a default on
> 2.3.x/trunk, XMLBinding out fault interceptor will only report the
> exception (as in this case) if the propagation has been disabled.

Are you sure on that?   By default, at least with the soap cases, exceptions 
are NOT propogated up to the servlet container.   We handle them ourselves, 
map them to the appropriate 500 status code, create the soap fault, etc...    
Nothing is sent up to the container.

Dan



> 
> Cheers, Sergey
> 
> > Dan
> > 
> > On Friday 04 February 2011 4:53:09 pm Andrew wrote:
> > > Hi,
> > > 
> > > I'm doing some basic stress testing of my JAX-RS service and getting
> > > back
> > > 
> > > some 500 responses, with body:
> > >  JAXBException occurred : Read timed out. Read timed out.
> > > 
> > > and
> > > 
> > >  <ns1:XMLFault
> > > 
> > > xmlns:ns1="http://cxf.apache.org/bindings/xformat"><ns1:faultstring
> > > xmlns:ns1="http://cxf.apache.org/bindings/xformat
> > 
> > ">java.net.SocketTimeoutE
> > 
> > > xception: Read timed out</ns1:faultstring></ns1:XMLFault>
> > > 
> > > On the service side I see the exceptions logged at WARN:
> > > 
> > > 2011-02-04 14:19:57,621 [http-8080-5] WARN
> > > org.apache.cxf.phase.PhaseInterceptorChain[369] - Interceptor for {
> > > http://foo.com/}CommandResourceImpl has thrown exception, unwinding now
> > > org.apache.cxf.interceptor.Fault: Read timed out
> > > 
> > >     at
> > 
> > org.apache.cxf.interceptor.LoggingInInterceptor.logging(LoggingInIntercep
> > to
> > 
> > > r.java:201)
> > > 
> > > 2011-02-04 14:19:57,928 [http-8080-38] WARN
> > > org.apache.cxf.jaxrs.provider.AbstractJAXBProvider[508] -
> > > javax.xml.bind.UnmarshalException
> > > 
> > >  - with linked exception:
> > > [org.xml.sax.SAXParseException: Premature end of file.]
> > > 
> > > but I'd like to handle these exceptions myself.  Is there a way to
> > 
> > capture
> > 
> > > these exceptions on the service side?  I'm using CXF 2.2.11  Thanks,
> > > 
> > > Andrew
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Mime
View raw message