{"id":"5d60d1d0cfd878ab","repo":"spring-projects/spring-framework","slug":"no-property-propertyname-found","errorCode":null,"errorMessage":"No property '${propertyName}' found","messagePattern":"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/e8729d043887bf0d0baf91e062e909b56eb2b708/spring-beans/src/main/java/org/springframework/beans/BeanWrapperImpl.java#L166-L202","documentation":"Thrown by BeanWrapperImpl.convertForProperty (InvalidPropertyException) when CachedIntrospectionResults.getPropertyDescriptor returns null for the requested property name. It means the JavaBeans Introspector found no accessor matching that exact name on the wrapped class, so Spring cannot determine a target type to convert to.","triggerScenarios":"Calling beanWrapper.convertForProperty(value, \"foo\") or a SpEL/property binding path where 'foo' has no getFoo/setFoo/getisFoo accessor on the wrapped class; using a typo; targeting a field that exists but has no public accessor (e.g. private field with no getter).","commonSituations":"YAML/properties binding to a key the @ConfigurationProperties class renamed or never had; refactor left stale property keys; Kotlin class with private backing field and no JVM-visible getter; record component name mismatch (case sensitivity).","solutions":["Verify the property name matches a public getter/setter exactly (case-sensitive, 'foo' -> getFoo/isFoo/setFoo).","If using @ConfigurationProperties, regenerate metadata and confirm the field has standard accessors.","Switch to a field-access BeanWrapper (DirectFieldAccessor) if the field is private with no accessor.","Use PropertyMatches.forProperty(...) to surface the closest matches and catch typos."],"exampleFix":"// before\nwrapper.convertForProperty(value, \"firtName\"); // typo\n\n// after\nwrapper.convertForProperty(value, \"firstName\");\n// or discover the right name\nString[] hints = PropertyMatches.forProperty(\"firtName\", clazz).getPossibleMatches();","handlingStrategy":"validation","validationCode":"// Verify the property exists before converting\nPropertyDescriptor pd = BeanUtils.getPropertyDescriptor(wrapper.getWrappedClass(), propertyName);\nif (pd == null) {\n    throw new IllegalArgumentException(\"No such property: \" + propertyName\n        + \" on \" + wrapper.getWrappedClass().getName());\n}\nwrapper.convertForProperty(value, propertyName);","typeGuard":"static boolean hasReadableProperty(ConfigurablePropertyAccessor wrapper, String name) {\n    return wrapper.isReadableProperty(name);\n}","tryCatchPattern":"try {\n    return wrapper.convertForProperty(value, propertyName);\n} catch (InvalidPropertyException ex) {\n    // PropertyMatches surfaces closest existing names\n    PropertyMatches pm = PropertyMatches.forProperty(propertyName, wrapper.getWrappedClass());\n    throw new IllegalArgumentException(pm.buildErrorMessage(), ex);\n}","preventionTips":["Centralize property name constants instead of passing string literals.","Generate @ConfigurationProperties metadata so IDEs flag invalid keys.","For dynamic names, always call isReadableProperty/isWritableProperty first.","Unit-test property paths after renames."],"tags":["beanwrapper","property","introspection","spring-beans"],"analyzedSha":"e8729d043887bf0d0baf91e062e909b56eb2b708","analyzedAt":"2026-08-04T19:07:39.725Z","schemaVersion":2}