{"id":"d49c579e65673efc","repo":"spring-projects/spring-framework","slug":"no-property-handler-found","errorCode":null,"errorMessage":"No property handler found","messagePattern":"No property handler found","errorType":"exception","errorClass":"InvalidPropertyException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java","lineNumber":267,"sourceCode":"\t\t\tsetPropertyValue(tokens, pv);\n\t\t}\n\t}\n\n\tprotected void setPropertyValue(PropertyTokenHolder tokens, PropertyValue pv) throws BeansException {\n\t\tif (tokens.keys != null) {\n\t\t\tprocessKeyedProperty(tokens, pv);\n\t\t}\n\t\telse {\n\t\t\tprocessLocalProperty(tokens, pv);\n\t\t}\n\t}\n\n\t@SuppressWarnings({\"rawtypes\", \"unchecked\"})\n\tprivate void processKeyedProperty(PropertyTokenHolder tokens, PropertyValue pv) {\n\t\tObject propValue = getPropertyHoldingValue(tokens);\n\t\tPropertyHandler ph = getLocalPropertyHandler(tokens.actualName);\n\t\tif (ph == null) {\n\t\t\tthrow new InvalidPropertyException(\n\t\t\t\t\tgetRootClass(), this.nestedPath + tokens.actualName, \"No property handler found\");\n\t\t}\n\t\tAssert.state(tokens.keys != null, \"No token keys\");\n\t\tString lastKey = tokens.keys[tokens.keys.length - 1];\n\n\t\tif (propValue.getClass().isArray()) {\n\t\t\tClass<?> componentType = propValue.getClass().componentType();\n\t\t\tint arrayIndex = Integer.parseInt(lastKey);\n\t\t\tObject oldValue = null;\n\t\t\ttry {\n\t\t\t\tif (isExtractOldValueForEditor() && arrayIndex < Array.getLength(propValue)) {\n\t\t\t\t\toldValue = Array.get(propValue, arrayIndex);\n\t\t\t\t}\n\t\t\t\tObject convertedValue = convertIfNecessary(tokens.canonicalName, oldValue, pv.getValue(),\n\t\t\t\t\t\tcomponentType, ph.nested(tokens.keys.length));\n\t\t\t\tint length = Array.getLength(propValue);\n\t\t\t\tif (arrayIndex >= length && arrayIndex < getAutoGrowCollectionLimit()) {\n\t\t\t\t\tObject newArray = Array.newInstance(componentType, arrayIndex + 1);","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java#L249-L285","documentation":"Thrown in processKeyedProperty when writing an indexed/mapped property such as 'items[0]' or 'map[key]'. The code resolves the enclosing value fine, then asks getLocalPropertyHandler(tokens.actualName) for the named property; if no handler exists (the bean has no getter/setter for that name) an InvalidPropertyException with 'No property handler found' is raised. It indicates the indexed/mapped accessor was applied to a name the bean does not expose.","triggerScenarios":"wrapper.setPropertyValue(\"items[0]\", x) on a bean with no getItems/setItems; binding into 'records[3].name' where 'records' is not a recognized property of the bean; a SpEL/BeanWrapper path with a misspelled collection field followed by an index.","commonSituations":"Form binding onto a DTO where the collection field was renamed; mapping external data into a bean via BeanWrapper with an incorrect field name; refactoring that dropped a getter/setter but left binding paths referencing it.","solutions":["Verify the bean exposes a getter/setter for the base property named before the index (tokens.actualName).","Correct the spelling of the collection/map field in the property path.","If binding untrusted/loose data, mark unknown fields to be ignored at the binder level."],"exampleFix":"// before\npublic class Order { private List<Item> lines; public List<Item> getLines() { return lines; } public void setLines(List<Item> l) { this.lines = l; } }\nwrapper.setPropertyValue(\"items[0]\", newItem); // wrong name\n\n// after\nwrapper.setPropertyValue(\"lines[0]\", newItem);","handlingStrategy":"validation","validationCode":"String base = path.replaceAll(\"\\\\[.*$\", \"\");\nif (wrapper.getPropertyHandler(base) != null) {\n    wrapper.setPropertyValue(path, value);\n}","typeGuard":"static boolean hasIndexedBase(BeanWrapper bw, String path) {\n    String base = path.replaceAll(\"\\\\[.*$\", \"\");\n    return bw.isReadableProperty(base) || bw.isWritableProperty(base);\n}","tryCatchPattern":"try { wrapper.setPropertyValue(path, value); }\ncatch (InvalidPropertyException ex) { /* log path, skip */ }","preventionTips":["Confirm the base collection/map property has a getter before using bracket syntax.","Keep binding paths in sync with bean field names."],"tags":["spring-beans","bean-wrapper","indexed-property","property-handler"],"analyzedSha":"e8729d043887bf0d0baf91e062e909b56eb2b708","analyzedAt":"2026-08-04T19:07:39.725Z","schemaVersion":2}