users@jersey.java.net

[Jersey] Changed behaviour for ExceptionMapper in Jersey 2.2 compared to Jersey 2.1

From: Jonas Oscarsson <jonas.osc_at_rsson.nu>
Date: Tue, 3 Sep 2013 13:36:23 +0200

Hi,

Don't know if this is the right place to ask about this, but if it isn't
please direct me.

I recently upgraded to Jersey 2.2 and found that my custom ExceptionMapper
stopped working for my custom ValidationExceptions.

In my implementation of AbstractBinder I have
*bind(ConfiguredValidatorImpl.class).to(ConfiguredValidator.class);*
*
*
The *ConfiguredValidtorImpl* is a custom implementation of the Jersey
interface *ConfiguredValidator*. The custom ConfiguredValidatorImpl
implements *validateResourceAndInputParams()* and throws exceptions
inheriting from my custom ValidationException (such as BadFieldException or
MissingFieldException). I have then configured an ExceptionMapper for
ValidationException, writing a custom response when this exception occurs.

This works as intended in Jersey 2.0 and Jersey 2.1, but after upgrade to
Jersey 2.2 the ExceptionMapper is not invoked.

Has there been any changes to ExceptionMapper logic in Jersey 2.2? Does
anyone know of a possible cause for my particular case to stop working?

Let me know if I need to clarify anything.

/ Jonas