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

smallrye client 'Cannot construct instance of java.util.ArrayList' #1228

Closed
johnaohara opened this issue Mar 5, 2019 · 0 comments
Closed
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@johnaohara
Copy link
Member

When calling a rest endpoint that returns a List from a native application using smallrye rest client;

e.g.

    @Inject
    @RestClient
    IWidgetsService widgetsService;
...
    private List<String> getWidgets() {
        return widgetsService.getWidgets();
    }

with IWidgetsService defined as;

@Path("/")
@Produces("application/json")
@RegisterRestClient
public interface IWidgetsService {

    @GET
    @Path("widgets")
    List<String> getWidgets() ;

}

Causes the following exception;

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.util.ArrayList` (no Creators, like default construct, exist): no default no-arguments constructor found
 at [Source: (org.jboss.resteasy.client.jaxrs.internal.ClientResponse$InputStreamWrapper); line: 1, column: 1]

We need to register ArrayList for reflection so that it is available at runtime in the native service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants