"Could not find a suitable constructor" when fetching an interface from my resource class using Jersey 2

How can I make Jersey understand that it should use a specific class instead of an interface for a resource?

I had a working application with the Status resource. Then I extracted the IStatus interface and moved all the JAX-RS annotations. Now I get:

 org.glassfish.hk2.api.MultiException A MultiException has 1 exceptions. They are:1. java.lang.NoSuchMethodException: Could not find a suitable constructor in resource.IStatus class 

I know this works with RestEasy. Is there a way to get him to work with Jersey?

+3
source share
1 answer

Put the @Path class @Path in the implementation instead of the interface. Jersey is trying to create an instance of an interface that he cannot.

+4
source

Source: https://habr.com/ru/post/1260552/


All Articles