{"record":{"id":"db276246d387a007","repo":"quarkusio/quarkus","slug":"value-must-be-an-instance-of-list-for-resteasycl","errorCode":null,"errorMessage":"Value must be an instance of List<> for ResteasyClientBuilder setter method: ${builderMethodName}","messagePattern":"Value must be an instance of List<> for ResteasyClientBuilder setter method: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/QuarkusRestClientBuilder.java","lineNumber":673,"sourceCode":"\n    @Override\n    public RestClientBuilder property(String name, Object value) {\n        if (name.startsWith(RESTEASY_PROPERTY_PREFIX)) {\n            // Makes it possible to configure some of the ResteasyClientBuilder delegate properties\n            String builderMethodName = name.substring(RESTEASY_PROPERTY_PREFIX.length());\n            Method builderMethod = Arrays.stream(ResteasyClientBuilder.class.getMethods())\n                    .filter(m -> builderMethodName.equals(m.getName()) && m.getParameterCount() >= 1)\n                    .findFirst()\n                    .orElse(null);\n            if (builderMethod == null) {\n                throw new IllegalArgumentException(\"ResteasyClientBuilder setter method not found: \" + builderMethodName);\n            }\n            Object[] arguments;\n            if (builderMethod.getParameterCount() > 1) {\n                if (value instanceof List) {\n                    arguments = ((List<?>) value).toArray();\n                } else {\n                    throw new IllegalArgumentException(\n                            \"Value must be an instance of List<> for ResteasyClientBuilder setter method: \"\n                                    + builderMethodName);\n                }\n            } else {\n                arguments = new Object[] { value };\n            }\n            try {\n                builderMethod.invoke(builderDelegate, arguments);\n            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n                throw new IllegalStateException(\"Unable to invoke ResteasyClientBuilder method: \" + builderMethodName, e);\n            }\n        }\n        builderDelegate.property(name, value);\n        return this;\n    }\n\n    private Object newInstanceOf(Class<?> clazz) {\n        if (PROVIDER_FACTORY != null) {","sourceCodeStart":655,"sourceCodeEnd":691,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-classic/resteasy-client/runtime/src/main/java/io/quarkus/restclient/runtime/QuarkusRestClientBuilder.java#L655-L691","documentation":"When a resteasy.* property maps to a ResteasyClientBuilder method that takes more than one parameter, the library requires the value to be a List so it can be spread into the method arguments. This error is thrown when a multi-argument builder method is invoked but the supplied value is not a List. It is a configuration/usage type mismatch detected at builder time.","triggerScenarios":"Calling property(\"resteasy.someMultiArgMethod\", someNonListValue) where ResteasyClientBuilder.someMultiArgMethod has parameterCount > 1, or configuring such a key with a scalar/string value.","commonSituations":"Configuring multi-argument builder options (e.g. host/port pairs) via YAML or .property() with a plain string; users expecting automatic conversion from a comma-separated string to arguments.","solutions":["Wrap the value in a java.util.List whose elements match the method's parameter types in order","Use a single-argument equivalent method/property if one exists","If set from config, ensure the config value binds as a list (e.g. comma-separated values into a List-typed config property)"],"exampleFix":"// before\nbuilder.property(\"resteasy.connectionTTL\", \"2000, MILLISECONDS\");\n// after\nbuilder.property(\"resteasy.connectionTTL\", List.of(2000L, TimeUnit.MILLISECONDS));","handlingStrategy":"type-guard","validationCode":"Method m = Arrays.stream(ResteasyClientBuilder.class.getMethods())\n    .filter(x -> x.getName().equals(methodName)).findFirst().orElse(null);\nif (m != null && m.getParameterCount() > 1 && !(value instanceof List)) {\n    throw new IllegalArgumentException(methodName + \" requires a List value\");\n}","typeGuard":"static boolean isListValue(Object v) { return v instanceof List<?>; }","tryCatchPattern":"try {\n    builder.property(\"resteasy.\" + name, value);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"List<>\")) { value = List.of(value); /* retry or fix */ }\n}","preventionTips":["Pass java.util.List for any multi-argument builder method","Match list element types to the method's parameter order and types","Avoid string-encoded argument tuples in config"],"tags":["restclient","reflection","type-mismatch"],"backgroundTag":"invalid-argument-value","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"}