javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/xml and type interface java.util.List

Viewed 629

I have implemented a simple rest endpoint that returns a Response that contains a

List<String>

The client is implemented with jaxrs 2.0 and with resteasy as impl since I am using wildfly in my project. When I fetch the results I keep taking the following exception

javax.ws.rs.ProcessingException: RESTEASY003145: Unable to find a MessageBodyReader of content-type application/xml and type interface java.util.List

at org.jboss.resteasy.core.interception.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:42)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:80)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:324)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:251)
at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:245)

Here is the code from the client that produces the error. If I request JSON it works fine but with xml I get the above exception.

Invocation.Builder request = rTarget.path("/containers/instances/{id}/kbase/{kbaseName}").resolveTemplate("id", containerAlias).resolveTemplate("kbaseName", getKbase()).
            request(MediaType.APPLICATION_XML).accept(MediaType.APPLICATION_XML);

    return request.get().readEntity(new GenericType<List<String>>(){});

and here are my depedencies so far

<!-- Test scope dependencies -->
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-client</artifactId>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.jboss.resteasy/jaxrs-api -->
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>jaxrs-api</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson2-provider</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jackson-provider</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxb-provider</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-multipart-provider</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jettison-provider</artifactId>
        <scope>test</scope>
    </dependency>

any help wou;d be much appreciated. Thanks in advance

0 Answers
Related