Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registerDefaultExceptionMappers: false still maps ValidationExceptionMapper #2380

Closed
andrewoh531 opened this issue Jun 8, 2018 · 3 comments

Comments

@andrewoh531
Copy link

andrewoh531 commented Jun 8, 2018

We've configured Dropwizard not to register default exception mappers by setting registerDefaultExceptionMappers: false in the yml file. However it's still mapping org.glassfish.jersey.server.validation.internal.ValidationExceptionMapper and is messing with our catch-all exception handler.

Why is this not excluded and is there a way to remove it?

@nickbabcock
Copy link
Contributor

registerDefaultExceptionMappers is for toggling if dropwizard should register its own exception mappers, it doesn't make reference to any of Jersey's internal exception mappers (eg: ValidationExceptionMapper).

I looked into it a little bit, and I'm not sure if using standard dropwizard code if ValidationExceptionMapper will be registered in the first place. Looking at the Jersey source code, it appears it is only registered if ValidationFeature is registered (which dropwizard doesn't). So I'd check if you're are registering either ValidationFeature or ValidationBinder (and if so, remove them)

@andrewoh531
Copy link
Author

Thanks! I did some more digging around and it appears it's registered by Jersey. Here's an open issue against Jersey on the issue: https://github.com/jersey/jersey/issues/3425

I was hoping there might be a more elegant way but looks like there isn't :(

@ktalebian
Copy link

@andrewoh531 did you ever fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants