Hi Dan

On Mon, Feb 7, 2011 at 4:35 PM, Daniel Kulp <[email protected]> wrote:

> 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.
>
> The propagation of the uncaught exceptions is required by the JAX-RS spec
so I did a minor update the other day to the out fault interceptor - and I
even have 2 tests :-).
JAXRSClientServerBookTest#testPropogateException &
JAXRSClientServerBookTest#testPropogateException2 (with the typos in the
names of the tests).

JAXRSClientServerBookTest#testPropogateException2 will report an exception
text as formatted by XMLBinding - because the propagation has been disabled
by setting an "org.apache.cxf.propagate.exception" to false...

cheers, Sergey

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
> > > [email protected]
> > > http://dankulp.com/blog
>
> --
> Daniel Kulp
> [email protected]
> http://dankulp.com/blog
>

Reply via email to