ExceptionMapper not working with @Provider annotaion
See original GitHub issueEnvironment Details
- Helidon Version: 2.0.0-M3
- Helidon MP
- JDK version: 11
- OS: macOS Catalina
Problem Description
I created the following ExceptionMapper using the @Provider
annotation:
@Provider
public class ConstraintViolationExceptionMapper implements ExceptionMapper<ConstraintViolationException> {
@Override
public Response toResponse(ConstraintViolationException e) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
}
But for some reason it’s not recognized by the application. I could make it work when I manually registered it in my Application class. Is this the intended behavior?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
toResponse in jersey ExceptionMapper does not get invoked
When I moved to jersey v > 2.5, it stopped working. I resolved this very issue by putting @Singleton annotation instead of @Component...
Read more >ExceptionMapper not working with @Provider annotaion #1857
Problem Description. I created the following ExceptionMapper using the @Provider annotation: @Provider public class ...
Read more >Java Configuration with Jersey @Provider ExceptionMapper ...
Declaring a (Jersey, not javax.servlet) filter and annotating my resource with it worked perfectly! RestErrorFilter.java import com.sun.jersey.
Read more >Defining exception mappers for resource exceptions and errors
ExceptionMapper class and annotate the class with the javax.ws.rs.ext.Provider annotation. This step assumes that your JAX-RS resource can throw ...
Read more >How to handle Exceptions in JAX-RS applications
How does the process work? Firstly, the Web container searches for an Exception Mapper. If found, the Exception Mapper will handle the error ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing as
cannot reproduce
. Please re-open if necessary.@antonio-petricca Please re-open with a reproducer.