Hello:
I am noticing that when there is an exception in the Jersey framework code,
specifically when marshalling json into an object (via jaxb) throws a
NullPointerException, that the exception mappers never get called to convert
that exception into a proper response. I have an exception mapper that maps
all Throwable exceptions into 500 errors but it only passes the
exception.getMessage() in the body rather than the full stack trace. In
these exceptions I'm seeing the full stack traces which is leading my down
this thinking.
I scanned the jsr311 and it states:
When a resource class or provider method throws an exception, the
JAX-RS runtime will attempt to map the exception to a suitable HTTP response
- see section 3.3.4<
https://jsr311.dev.java.net/nonav/releases/1.0/spec/spec3.html#x3-280003.3.4>.
An application can supply exception mapping providers to customize this
mapping.
To me that sounds like when a provider (in this case the jaxbjson marshaller
using natural) throws an exception, that Jersey should be mapping that via
the exception mappers.
I can probably write a quick unit test to try to replicate this, but just
thought I'd throw it on the mailing list to see if I'm completely wrong
first.
Thanks again
Andy O