[Jersey] Re: How to catch MessageBodyProviderNotFoundException.

From: Miroslav Fuksa <>
Date: Fri, 23 Aug 2013 13:31:08 +0200


JAX-RS spec (section 4.4) defines, that ExceptionMappers should handle
exceptions thrown from user resources and providers. In this case the
exception is thrown from Jersey code responsible for searching for the
appropriate provider and therefore it is not mapped. From my point of
view, a missing message body provider is something that should be fixed
by the application developer and there is no need to handle this kind of
error in ExceptionMappers. But maybe I am missing something. What is
your use case of handling this error?


On 08/23/2013 12:59 PM, wrote:
> I have not annotated it with Provider, but instead registering it in
> the application directly like:
> public class MyApplication extends ResourceConfig {
> public MyApplication() {
> register(MyGlobalExceptionMapper.class);
> Note that I'm also using the Spring integration but I assume that
> should cause no issues.