quarkusio/quarkus · error · NotSupportedException

No supported MessageBodyReader found

Error message

No supported MessageBodyReader found

What it means

Thrown as NotSupportedException when no registered MessageBodyReader can deserialize the request body into the declared parameter type for the effective request media type. The reader set is consulted via isReadable(type, genericType, annotations, mediaType) and none matched.

Source

Thrown at independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/handlers/RequestDeserializeHandler.java:108

                                    serialisers)
                                    .proceed();
                        }
                    } catch (NoContentException e) {
                        throw new BadRequestException(e);
                    }
                } catch (Exception e) {
                    log.debug("Error occurred during deserialization of input", e);
                    requestContext.handleException(e, true);
                    requestContext.resume();
                    return;
                }
                requestContext.setRequestEntity(result);
                requestContext.resume();
                return;
            }
        }
        log.debugv("No matching MessageBodyReader found for type {0} and media type {1}", type, effectiveRequestType);
        throw new NotSupportedException("No supported MessageBodyReader found");
    }

    private boolean isReadable(MessageBodyReader<?> reader, ResteasyReactiveRequestContext requestContext,
            MediaType requestType) {
        if (reader instanceof ServerMessageBodyReader) {
            return ((ServerMessageBodyReader<?>) reader).isReadable(type, genericType,
                    requestContext.getTarget().getLazyMethod(),
                    requestType);
        }
        return reader.isReadable(type, genericType, getAnnotations(requestContext), requestType);
    }

    @SuppressWarnings("unchecked")
    public Object readFrom(MessageBodyReader<?> reader, ResteasyReactiveRequestContext requestContext, MediaType requestType)
            throws IOException {
        requestContext.requireCDIRequestScope();
        if (reader instanceof ServerMessageBodyReader) {
            return ((ServerMessageBodyReader<?>) reader).readFrom((Class) type, genericType, requestType, requestContext);

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add the matching binding extension (e.g. quarkus-rest-jackson) or fix the client Content-Type to match available readers
  2. Register a custom MessageBodyReader for the type with @Provider
  3. Annotate the endpoint parameter with a supported type or accept String/InputStream and parse manually
  4. Verify the entity type is a supported concrete class (interfaces/generics may not resolve)

Example fix

// before: no reader for MyDto as application/json
@POST
public void create(MyDto dto) { ... }
// after: add dependency
// <dependency>io.quarkus:quarkus-rest-jackson</dependency>
// and ensure Content-Type: application/json on the request
Defensive patterns

Strategy: type-guard

Validate before calling

if (!isReadableFor(type, contentType)) return Response.status(415).build();

Type guard

static boolean hasReader(Class<?> type, MediaType mt) {
    return readers.stream().anyMatch(r -> r.isReadable(type, type, new java.lang.annotation.Annotation[0], mt));
}

Try / catch

try { return resource.post(body); } catch (NotSupportedException e) { if (e.getMessage().contains("MessageBodyReader")) { /* add binding extension or custom reader */ } throw e; }

Prevention

When it happens

Trigger: POST/PUT body whose Content-Type has no matching reader for the target Java type, e.g. JSON sent to a method expecting a type without a Jackson ObjectMapper registration, or a custom type with no Provider; sending application/xml when only JSON binding is on the classpath.

Common situations: Missing quarkus-rest-jackson (or other serializer) dependency; sending multipart/CSV/plain text for a POJO; custom types needing a custom MessageBodyReader that was never registered; wrong Content-Type header on the client.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/91b0522a4dcdeb10. Report an issue: GitHub.