quarkus restclient RESTEASY003145: Unable to find a MessageBodyReader of content-type applicati
时间: 2024-03-11 18:47:46 浏览: 52
on/json and type class java.util.List in Quarkus Rest Client
This error indicates that Quarkus Rest Client is unable to find a suitable MessageBodyReader for parsing the response from a REST API which returns JSON data. This can happen when the API returns an unexpected content-type or when the response data is not formatted correctly.
To resolve this issue, you can try adding the following dependency to your project:
```
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>${resteasy.version}</version>
</dependency>
```
This dependency provides a MessageBodyReader implementation for parsing JSON data using the Jackson library. You may also need to configure your Quarkus Rest Client to use this provider by adding the following annotation to your REST client interface:
```
@RegisterProvider(value = JacksonJsonProvider.class, priority = Priorities.USER)
```
This should resolve the issue and allow Quarkus Rest Client to properly parse JSON responses.
阅读全文