users@jersey.java.net

[Jersey] Re: How to override a built-in exception mapper in Jersey 2.23?

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Wed, 10 Aug 2016 12:02:06 +0200

Hi Greg,

seems like a regression. (Its not definitely something we did
intentionally, but I know there were some fixes related to bean
validation, which might have changed the behavior. Generally, user
defined @Provider should have always higher priority than anything
provided by Jersey).

Can you please file a bug, ideally with a reproducer?

Thanks,
Pavel


On 10/08/16 11:39, Grzegorz wrote:
> Hi all,
>
> In one of my projects I've already upgraded Jersey from version *2.14*
> to *2.23*. But I'm struggling many hours with one problem.
> My project defines its own ExceptionMapper for a
> "ValidationException", but unfortunately Jersey already has a built-in
> exception mapper for this exception:
> |org.glassfish.jersey.server.validation.internal.ValidationExceptionMapper| and
> I cannot override it.
>
> I've also tried to use @Priority annotation for my custom mapper, but
> unfortunately Jersey doesn't take it into account. In the previous
> Jersey version (2.14) my mapper used to overwrite the built-in one.
> And IMHO it was very intiuitive.
>
> What is going on? Is it a regression bug or an intended change?
>
> Kind Regards,
> Greg