{"record":{"id":"03687dc63d1cee98","repo":"quarkusio/quarkus","slug":"unsupported-type-rawtype-getname-use-inputs","errorCode":null,"errorMessage":"Unsupported type: ${rawType.getName()}. Use InputStream, String, or byte[].","messagePattern":"Unsupported type: (.+?)\\. Use InputStream, String, or byte\\[\\]\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/EntityPartImpl.java","lineNumber":100,"sourceCode":"        if (rawType == InputStream.class) {\n            return rawType.cast(content);\n        }\n        if (rawType == String.class) {\n            return rawType.cast(new String(content.readAllBytes(), java.nio.charset.StandardCharsets.UTF_8));\n        }\n        if (rawType == byte[].class) {\n            return rawType.cast(content.readAllBytes());\n        }\n        if (serialisers != null) {\n            List<MessageBodyReader<?>> readers = serialisers.findReaders(null, rawType, mediaType);\n            for (MessageBodyReader<?> r : readers) {\n                if (r.isReadable(rawType, genericType, EMPTY_ANNOTATIONS, mediaType)) {\n                    MessageBodyReader<T> reader = (MessageBodyReader<T>) r;\n                    return reader.readFrom(rawType, genericType, EMPTY_ANNOTATIONS, mediaType, headers, content);\n                }\n            }\n        }\n        throw new IllegalArgumentException(\n                \"Unsupported type: \" + rawType.getName() + \". Use InputStream, String, or byte[].\");\n    }\n\n    @Override\n    public MultivaluedMap<String, String> getHeaders() {\n        return headers;\n    }\n\n    @Override\n    public MediaType getMediaType() {\n        return mediaType;\n    }\n\n    public static boolean isEntityPartList(Type type) {\n        if (type instanceof ParameterizedType pt) {\n            if (pt.getRawType() == List.class) {\n                Type[] args = pt.getActualTypeArguments();\n                return args.length == 1 && args[0] == EntityPart.class;","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/jaxrs/EntityPartImpl.java#L82-L118","documentation":"EntityPartImpl.readContent, invoked from the typed getContent overloads, throws IllegalArgumentException when no MessageBodyReader is readable for the requested raw type at the part's media type. The builtin fallbacks handle InputStream, String, and byte[]; anything else requires a registered reader for that media type. The message suggests those three types.","triggerScenarios":"Calling part.getContent(MyCustomPojo.class) where the part's media type has no matching readable MessageBodyReader registered (no JSON provider for application/json, or a type the provider rejects via isReadable).","commonSituations":"Missing quarkus-resteasy-reactive-jackson or JSON-B provider on the classpath; requesting a POJO from a part whose media type is application/octet-stream; using an exotic type (Map without type info, custom container types) unsupported by the configured reader.","solutions":["Use one of the guaranteed types — InputStream, String, or byte[] — and deserialize manually.","Ensure a JSON provider (Jackson or JSON-B) is present and the part's media type is application/json so the reader can match.","Check that the requested type is one the provider's isReadable accepts (e.g. a concrete bean, not Object or an unmapped interface).","Register a custom MessageBodyReader for the type if it must be read directly."],"exampleFix":"// before\nMyPojo pojo = part.getContent(MyPojo.class); // no reader for media type\n// after\nString json = part.getContent(String.class);\nMyPojo pojo = jsonb.fromJson(json, MyPojo.class);","handlingStrategy":"fallback","validationCode":"// Verify a JSON provider exists for the target type before reading\n// Safer: read as String and convert manually\nString raw = part.getContent(String.class);\nMyPojo pojo = jsonb.fromJson(raw, MyPojo.class);","typeGuard":"static boolean isDirectlyReadable(Class<?> rawType) {\n    return InputStream.class.isAssignableFrom(rawType)\n        || String.class.equals(rawType)\n        || byte[].class.equals(rawType);\n}","tryCatchPattern":"try {\n    return part.getContent(MyPojo.class);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unsupported type:\")) {\n        String json = part.getContent(String.class); // NOTE: only if content not yet consumed\n        return jsonb.fromJson(json, MyPojo.class);\n    }\n    throw e;\n}","preventionTips":["Add quarkus-resteasy-reactive-jackson (or JSON-B) so POJO parts are readable.","Check the part's media type matches the reader you expect (application/json).","Default to reading String/byte[] when the type support is uncertain."],"tags":["resteasy-reactive","multipart","messagebodyreader","unsupported-type","jax-rs"],"backgroundTag":"unsupported-media-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}