{"record":{"id":"484bc25b81ee60fc","repo":"quarkusio/quarkus","slug":"class-configpropertiesclassinfo-which-is-ann","errorCode":null,"errorMessage":"Class  + configPropertiesClassInfo +  which is annotated with  + ConfigurationPropertiesProcessor.CONFIGURATION_PROPERTIES +  must contain a no-arg constructor","messagePattern":"Class  \\+ configPropertiesClassInfo \\+  which is annotated with  \\+ ConfigurationPropertiesProcessor\\.CONFIGURATION_PROPERTIES \\+  must contain a no-arg constructor","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ClassConfigurationPropertiesUtil.java","lineNumber":165,"sourceCode":"                                        String.class),\n                                bc.get(mc.this_().field(configClassToFieldDesc.get(configClass))));\n                    }\n                    bc.return_(); // the method doesn't need to do anything\n                });\n            });\n        });\n    }\n\n    /**\n     * @return true if the configuration class needs validation\n     */\n    boolean addProducerMethodForClassConfigProperties(ClassLoader classLoader, ClassInfo configPropertiesClassInfo,\n            String prefixStr, ConfigMapping.NamingStrategy namingStrategy,\n            boolean failOnMismatchingMember,\n            ConfigurationPropertiesMetadataBuildItem.InstanceFactory instanceFactory) {\n\n        if ((instanceFactory == null) && !configPropertiesClassInfo.hasNoArgsConstructor()) {\n            throw new IllegalArgumentException(\n                    \"Class \" + configPropertiesClassInfo + \" which is annotated with \"\n                            + ConfigurationPropertiesProcessor.CONFIGURATION_PROPERTIES\n                            + \" must contain a no-arg constructor\");\n        }\n\n        String configObjectClassStr = configPropertiesClassInfo.name().toString();\n\n        boolean needsValidation = needsValidation();\n        String[] produceMethodParameterTypes = new String[needsValidation ? 2 : 1];\n        produceMethodParameterTypes[0] = Config.class.getName();\n        if (needsValidation) {\n            produceMethodParameterTypes[1] = VALIDATOR_CLASS;\n        }\n\n        /*\n         * Add a method like this:\n         *\n         * @Produces","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/spring-boot-properties/deployment/src/main/java/io/quarkus/spring/boot/properties/deployment/ClassConfigurationPropertiesUtil.java#L147-L183","documentation":"Spring Boot style @ConfigurationProperties classes bound by the quarkus-spring-boot-properties extension need to be instantiated reflectively. When no custom instance factory is provided, the class must have a no-arg constructor; otherwise Quarkus cannot create the config object at build time and fails the build.","triggerScenarios":"addProducerMethodForClassConfigProperties is invoked (via needsValidation) for a @ConfigurationProperties-annotated class that lacks a public no-arg constructor and no InstanceFactory build item was registered.","commonSituations":"Migrating a Spring Boot app to Quarkus where the properties class uses constructor binding / @AllArgsConstructor without keeping a default constructor; Kotlin or Lombok classes generating only parameterized constructors.","solutions":["Add a public no-arg constructor to the @ConfigurationProperties class.","Register a custom InstanceFactory (ConfigurationPropertiesMetadataBuildItem.InstanceFactory) if the class cannot have a no-arg constructor.","Add @NoArgsConstructor (Lombok) or a default constructor while keeping setters for binding."],"exampleFix":"// before\n@ConfigurationProperties(\"app\")\npublic class AppProps {\n    private final String name;\n    public AppProps(String name) { this.name = name; }\n}\n// after\n@ConfigurationProperties(\"app\")\npublic class AppProps {\n    private String name;\n    public AppProps() { }\n    public String getName() { return name; }\n    public void setName(String name) { this.name = name; }\n}","handlingStrategy":"validation","validationCode":"static void checkNoArgConstructor(Class<?> propsClass) {\n    if (Arrays.stream(propsClass.getDeclaredConstructors())\n            .noneMatch(c -> c.getParameterCount() == 0 && Modifier.isPublic(c.getModifiers()))) {\n        throw new IllegalArgumentException(propsClass + \" needs a public no-arg constructor\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a public no-arg constructor in all @ConfigurationProperties classes.","Avoid constructor-binding style when migrating Spring Boot properties to Quarkus.","If instantiation must be custom, register an InstanceFactory build item."],"tags":["quarkus","spring-boot","configuration-properties","build-time"],"backgroundTag":"missing-default-constructor","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"}