{"record":{"id":"cd544b09794f6bb1","repo":"apache/maven","slug":"unknown-bean-property-s","errorCode":null,"errorMessage":"Unknown bean property: %s","messagePattern":"Unknown bean property: (.+?)","errorType":"exception","errorClass":"XmlPullParserException","httpStatus":null,"severity":"error","filePath":"compat/maven-embedder/src/main/java/org/eclipse/sisu/plexus/PlexusXmlBeanConverter.java","lineNumber":259,"sourceCode":"        final Object bean = newImplementation(clazz);\n\n        // build map of all known bean properties belonging to the chosen implementation\n        final Map<String, BeanProperty<Object>> propertyMap = new HashMap<>();\n        for (final BeanProperty<Object> property : new BeanProperties(clazz)) {\n            final String name = property.getName();\n            if (!propertyMap.containsKey(name)) {\n                propertyMap.put(name, property);\n            }\n        }\n\n        while (parser.getEventType() == XmlPullParser.START_TAG) {\n            // update properties inside the bean, guided by the cached property map\n            final BeanProperty<Object> property = propertyMap.get(Roles.camelizeName(parser.getName()));\n            if (property != null) {\n                property.set(bean, parse(parser, property.getType()));\n                parser.nextTag();\n            } else {\n                throw new XmlPullParserException(\"Unknown bean property: \" + parser.getName(), parser, null);\n            }\n        }\n\n        return bean;\n    }\n\n    /**\n     * Parses an XML element looking for the name of a custom implementation.\n     *\n     * @param parser The XML parser\n     * @return Name of the custom implementation; otherwise {@code null}\n     */\n    private static String parseImplementation(final XmlPullParser parser) {\n        return parser.getAttributeValue(null, \"implementation\");\n    }\n\n    /**\n     * Attempts to load the named implementation, uses default implementation if no name is given.","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-embedder/src/main/java/org/eclipse/sisu/plexus/PlexusXmlBeanConverter.java#L241-L277","documentation":"While PlexusXmlBeanConverter populates a bean from a sequence of XML elements, each element name is camelized (dashes stripped) and looked up among the bean's writable properties. An element that matches no property aborts parsing with an XmlPullParserException naming the offending element, which bubbles up as a conversion failure for the whole value.","triggerScenarios":"A <configuration> XML block where an element's camelizeName() has no matching BeanProperty setter on the target class, e.g. <maximumRetries> when the bean only defines setMaxRetries.","commonSituations":"Typos or wrong casing in plexus.xml/components.xml element names; component upgraded so a property was renamed/removed while old XML config kept; configuration copied from a different implementation class.","solutions":["Match the element name to an actual setter: use <maxRetries> or <max-retries> (both camelize to maxRetries)","Check the target class version for available setters if the config worked before an upgrade","Remove stale elements that no longer correspond to any property","Use the element name printed in the exception to locate the offending line in the XML"],"exampleFix":"<!-- before: element does not match any setter on the bean -->\n<configuration>\n  <maximumRetries>5</maximumRetries>\n</configuration>\n\n<!-- after: Plexus camelizes element names, max-retries/maxRetries map to setMaxRetries -->\n<configuration>\n  <max-retries>5</max-retries>\n</configuration>","handlingStrategy":"try-catch","validationCode":"// Verify every element you plan to emit maps to a writable bean property\nSet<String> writable = new HashSet<>();\nfor (java.beans.PropertyDescriptor pd\n        : java.beans.Introspector.getBeanInfo(Server.class).getPropertyDescriptors()) {\n    if (pd.getWriteMethod() != null) writable.add(pd.getName());\n}\n// emitting <max-retries>/<maxRetries> is safe only if writable.contains(\"maxRetries\")\nif (!writable.contains(\"maxRetries\")) {\n    throw new IllegalStateException(\"Server has no settable property 'maxRetries'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    Object bean = converter.convert(role, value);\n} catch (IllegalArgumentException e) {\n    if (e.getCause() instanceof XmlPullParserException xe\n            && xe.getMessage().startsWith(\"Unknown bean property:\")) {\n        // xe.getMessage() names the offending element: fix or drop it in the XML\n        log.warn(\"Bad element in config for {}: {}\", role, xe.getMessage());\n    } else {\n        throw e;\n    }\n}","preventionTips":["Derive config element names from the bean's setters (camelCase or dashed form)","Refresh plexus configuration after upgrading components that renamed properties","Test configuration against the exact component version in CI"],"tags":["xml","plexus","configuration","typo","property-mapping"],"backgroundTag":"unknown-config-property","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}