{"record":{"id":"ac50b8d89ad91044","repo":"quarkusio/quarkus","slug":"no-classname-constructor-found-for-params-par","errorCode":null,"errorMessage":"No ${className}constructor found for params: ${parameterTypes}","messagePattern":"No (.+?)constructor found for params: (.+?)","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/Reflections.java","lineNumber":148,"sourceCode":"                constructor.setAccessible(true);\n            }\n            try {\n                return constructor.newInstance(args);\n            } catch (InvocationTargetException e) {\n                Throwable cause = e.getCause();\n                if (cause instanceof RuntimeException) {\n                    throw (RuntimeException) cause;\n                }\n                if (cause instanceof Error) {\n                    throw (Error) cause;\n                }\n                // this method is only used to instantiate beans, so throwing `CreationException` is fine\n                throw new CreationException(cause);\n            } catch (InstantiationException | IllegalAccessException | IllegalArgumentException e) {\n                throw new RuntimeException(\"Cannot invoke constructor: \" + clazz.getName(), e);\n            }\n        }\n        throw new RuntimeException(\n                \"No \" + clazz.getName() + \"constructor found for params: \" + Arrays.toString(parameterTypes));\n    }\n\n    public static Object readField(Class<?> clazz, String name, Object instance) {\n        try {\n            Field field = clazz.getDeclaredField(name);\n            if (!field.canAccess(instance)) {\n                field.setAccessible(true);\n            }\n            return field.get(instance);\n        } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {\n            throw new RuntimeException(\"Cannot read field value: \" + clazz.getName() + \"#\" + name, e);\n        }\n    }\n\n    public static void writeField(Class<?> clazz, String name, Object instance, Object value) {\n        try {\n            Field field = clazz.getDeclaredField(name);","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/arc/runtime/src/main/java/io/quarkus/arc/impl/Reflections.java#L130-L166","documentation":"Reflections.newInstance() first locates a declared constructor matching the requested parameter types; if none exists it throws this RuntimeException listing the class and the parameter types it searched for. Because the method is only used to instantiate beans, the missing constructor means the bean class does not expose the signature the container expects.","triggerScenarios":"Calling Reflections.newInstance(clazz, parameterTypes, args) with parameterTypes that do not match any declared constructor of clazz (including after class redefinition or stale generated code).","commonSituations":"A generated/synthetic bean was rebuilt against an outdated bean class signature; a bean class constructor signature changed after a refactor; wrong Class[] passed manually when instantiating a class reflectively in an extension or test.","solutions":["Compare the requested parameter types with the actual constructor signatures of the class","Regenerate/rebuild synthetic or generated bean code so it matches the current class signature","Add a no-arg or matching constructor to the bean class","Verify you pass the correct Class<?>[] (e.g. String.class, not Object.class)"],"exampleFix":"// before\nReflections.newInstance(Bean.class, new Class<?>[]{String.class}, new Object[]{42});\n// after\nReflections.newInstance(Bean.class, new Class<?>[]{String.class}, new Object[]{\"42\"});","handlingStrategy":"validation","validationCode":"boolean found = Arrays.stream(clazz.getDeclaredConstructors())\n    .anyMatch(c -> Arrays.equals(c.getParameterTypes(), parameterTypes));\nif (!found) throw new IllegalArgumentException(\"No matching constructor on \" + clazz);","typeGuard":null,"tryCatchPattern":"try { return Reflections.newInstance(clazz, types, args); }\ncatch (RuntimeException e) { log.error(\"Constructor lookup failed for \" + clazz + \" with \" + Arrays.toString(types), e); throw e; }","preventionTips":["Rebuild generated/synthetic code after changing bean class constructors","Keep a no-arg constructor on reflectively instantiated classes","Pass exact Class literals, not Object.class placeholders"],"tags":["cdi","reflection","constructor-not-found","quarkus-arc"],"backgroundTag":"constructor-signature-mismatch","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}