{"record":{"id":"cfdfd7b0c45250da","repo":"spring-projects/spring-framework","slug":"invalid-property-propertyname-of-bean-class-cfdfd7","errorCode":null,"errorMessage":"Invalid property '{propertyName}' of bean class [{beanClass.getName()}]: No property '{propertyName}' found","messagePattern":"Invalid property '(.+?)' of bean class \\[(.+?)\\]: No property '(.+?)' found","errorType":"exception","errorClass":"InvalidPropertyException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java","lineNumber":184,"sourceCode":"\t\treturn this.cachedIntrospectionResults;\n\t}\n\n\n\t/**\n\t * Convert the given value for the specified property to the latter's type.\n\t * <p>This method is only intended for optimizations in a BeanFactory.\n\t * Use the {@code convertIfNecessary} methods for programmatic conversion.\n\t * @param value the value to convert\n\t * @param propertyName the target property\n\t * (note that nested or indexed properties are not supported here)\n\t * @return the new value, possibly the result of type conversion\n\t * @throws TypeMismatchException if type conversion failed\n\t */\n\tpublic @Nullable Object convertForProperty(@Nullable Object value, String propertyName) throws TypeMismatchException {\n\t\tCachedIntrospectionResults cachedIntrospectionResults = getCachedIntrospectionResults();\n\t\tPropertyDescriptor pd = cachedIntrospectionResults.getPropertyDescriptor(propertyName);\n\t\tif (pd == null) {\n\t\t\tthrow new InvalidPropertyException(getRootClass(), getNestedPath() + propertyName,\n\t\t\t\t\t\"No property '\" + propertyName + \"' found\");\n\t\t}\n\t\tTypeDescriptor td = ((GenericTypeAwarePropertyDescriptor) pd).getTypeDescriptor();\n\t\treturn convertForProperty(propertyName, null, value, td);\n\t}\n\n\t@Override\n\tprotected @Nullable PropertyHandler getLocalPropertyHandler(String propertyName) {\n\t\tPropertyDescriptor pd = getCachedIntrospectionResults().getPropertyDescriptor(propertyName);\n\t\treturn (pd != null ? new BeanPropertyHandler((GenericTypeAwarePropertyDescriptor) pd) : null);\n\t}\n\n\t@Override\n\tprotected BeanWrapperImpl newNestedPropertyAccessor(Object object, String nestedPath) {\n\t\treturn new BeanWrapperImpl(object, nestedPath, this);\n\t}\n\n\t@Override","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/69bf83ad716d0cfc4b0520a19b4d8b24c79d1538/spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java#L166-L202","documentation":"Thrown by BeanWrapperImpl.convertForProperty(value, propertyName) when CachedIntrospectionResults.getPropertyDescriptor(propertyName) returns null - i.e. the bean exposes no property with that name. Spring raises InvalidPropertyException naming the root class and the (nested-path-prefixed) property.","triggerScenarios":"Calling beanWrapper.convertForProperty(value, \"xyz\") on a wrapped object whose class has no getter/setter for 'xyz'. Note: convertForProperty does not support nested/indexed paths.","commonSituations":"Typo in the property name, using convertForProperty with a nested path (which it does not support), or a DTO/entity that was regenerated without the expected field.","solutions":["Verify the property name matches exactly (case-sensitive) a JavaBeans property of the wrapped class.","For nested or indexed properties use setPropertyValue/getPropertyValue or convertForProperty(propertyName, null, value, typeDescriptor) instead of the two-arg overload.","Regenerate/refresh the model class so the expected property exists."],"exampleFix":"// before\nwrapper.convertForProperty(value, \"user.naem\"); // typo\n\n// after\nwrapper.convertForProperty(value, \"user.name\");","handlingStrategy":"validation","validationCode":"// before convertForProperty(value, name)\nPropertyDescriptor pd = wrapper.getPropertyDescriptor(name);\nif (pd == null) {\n    throw new IllegalArgumentException(\"no property \" + name);\n}\nwrapper.convertForProperty(value, name);","typeGuard":"static boolean hasReadableProperty(BeanWrapper w, String name) {\n    try { return w.getPropertyDescriptor(name) != null; }\n    catch (InvalidPropertyException e) { return false; }\n}","tryCatchPattern":null,"preventionTips":["List available properties via wrapper.getPropertyDescriptors() before programmatic access.","Remember convertForProperty(value, name) does NOT support nested/indexed paths.","Centralize property-name constants to avoid typos."],"tags":["bean-wrapper","property-access","spring-beans"],"backgroundTag":null,"analyzedSha":"69bf83ad716d0cfc4b0520a19b4d8b24c79d1538","analyzedAt":"2026-08-09T15:32:58.770Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}