{"record":{"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/69bf83ad716d0cfc4b0520a19b4d8b24c79d1538/spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java#L249-L285","documentation":"Thrown by processKeyedProperty when getLocalPropertyHandler(tokens.actualName) returns null for a property that is being addressed with a key/index (e.g. 'items[0]'). A keyed write needs a PropertyHandler to resolve element/key types and the setter; if no handler exists for the base property the framework cannot perform the indexed operation.","triggerScenarios":"Calling setPropertyValue(\"items[0]\", value) on a BeanWrapper where 'items' is not a recognized JavaBean property (no getter/setter and no field exposure) of the wrapped object.","commonSituations":"Binding to a public field directly with indexed syntax on a BeanWrapper that only honors getters/setters; misspelled collection property; wrapping a Map itself and using indexed syntax expecting map semantics on a non-property; using DirectFieldAccess that wasn't enabled so a field isn't seen as a property.","solutions":["Confirm the base property (e.g. 'items') has a getter (and setter for writes) on the wrapped bean.","Switch the accessor to direct field access (BeanWrapper / DirectFieldAccessor) if the value is a field with no accessor methods.","If binding into a Map held by the bean, target the property name then the key: 'myMap[key]' where 'myMap' is a real property.","Correct the property name spelling/case to match the bean."],"exampleFix":"// before\nwrapper.setPropertyValue(\"itemz[0]\", x); // property is 'items', not 'itemz' -> No property handler found\n\n// after\nwrapper.setPropertyValue(\"items[0]\", x);","handlingStrategy":"validation","validationCode":"BeanWrapper w = new BeanWrapperImpl(bean);\nString base = tokensBeforeIndex; // e.g. \"items\"\nif (w.getPropertyType(base) == null) {\n    throw new IllegalArgumentException(\"no property handler for \" + base);\n}\nw.setPropertyValue(base + \"[0]\", value);","typeGuard":"static boolean hasPropertyHandler(BeanWrapper w, String base) {\n    try { return w.getPropertyDescriptor(base) != null; }\n    catch (InvalidPropertyException e) { return false; }\n}","tryCatchPattern":"try {\n    wrapper.setPropertyValue(\"items[0]\", value);\n} catch (InvalidPropertyException ex) {\n    if (ex.getMessage().contains(\"No property handler\")) { /* expose field-access or fix name */ }\n    else throw ex;\n}","preventionTips":["Confirm collection/map properties have getters (and setters) — BeanWrapper honors accessors, not raw fields.","Switch to DirectFieldAccessor if you intentionally bind to public fields.","Add a property-descriptor check before indexed writes from user input."],"tags":["spring-beans","bean-wrapper","indexed-property","missing-property"],"backgroundTag":null,"analyzedSha":"69bf83ad716d0cfc4b0520a19b4d8b24c79d1538","analyzedAt":"2026-08-09T15:32:58.770Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}