So in my JAXRS application, I have 2 ExceptionMapper registered as @Provider
public class MyExceptionMapper implements ExceptionMapper<Exception> {...}
public class MyCustomRuntimeExceptionMapper implements ExceptionMapper<MyCustomRuntimeException> {...}
When my application throws a new "MyCustomRuntimeException", the exception is caught inside the MyExceptionMapper, even though (JAX-RS spec says) it should be caught inside MyCustomRuntimeExceptionMapper.
Here's what JAXRS says -
JAX-RS supports exception inheritance as well. When an exception is thrown, JAX-RS will first try and find an ExceptionMapper for that exception’s type. If it cannot find one, it will look for a mapper that can handle the exception’s superclass. It will continue this process until there are no more superclasses to match against.
Anyone have a clue, whats going on here? Thanks.