{"record":{"id":"3f2bef6fde728231","repo":"spring-projects/spring-framework","slug":"failed-to-re-introspect-class-beanclass-getname","errorCode":null,"errorMessage":"Failed to re-introspect class [{beanClass.getName()}]","messagePattern":"Failed to re-introspect class \\[(.+?)\\]","errorType":"exception","errorClass":"FatalBeanException","httpStatus":null,"severity":"error","filePath":"spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java","lineNumber":400,"sourceCode":"\t\t\tpd = this.propertyDescriptors.get(StringUtils.uncapitalize(name));\n\t\t\tif (pd == null) {\n\t\t\t\tpd = this.propertyDescriptors.get(StringUtils.capitalize(name));\n\t\t\t}\n\t\t}\n\t\treturn pd;\n\t}\n\n\tPropertyDescriptor[] getPropertyDescriptors() {\n\t\treturn this.propertyDescriptors.values().toArray(PropertyDescriptorUtils.EMPTY_PROPERTY_DESCRIPTOR_ARRAY);\n\t}\n\n\tprivate PropertyDescriptor buildGenericTypeAwarePropertyDescriptor(Class<?> beanClass, PropertyDescriptor pd) {\n\t\ttry {\n\t\t\treturn new GenericTypeAwarePropertyDescriptor(beanClass, pd.getName(), pd.getReadMethod(),\n\t\t\t\t\tpd.getWriteMethod(), pd.getPropertyEditorClass());\n\t\t}\n\t\tcatch (IntrospectionException ex) {\n\t\t\tthrow new FatalBeanException(\"Failed to re-introspect class [\" + beanClass.getName() + \"]\", ex);\n\t\t}\n\t}\n\n}\n","sourceCodeStart":382,"sourceCodeEnd":405,"githubUrl":"https://github.com/spring-projects/spring-framework/blob/69bf83ad716d0cfc4b0520a19b4d8b24c79d1538/spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java#L382-L405","documentation":"Thrown as FatalBeanException wrapping a java.beans.IntrospectionException when CachedIntrospectionResults.buildGenericTypeAwarePropertyDescriptor cannot construct a GenericTypeAwarePropertyDescriptor for an existing PropertyDescriptor (during interface introspection or re-wrapping). It indicates that re-introspecting an individual property descriptor failed even though the initial BeanInfo was obtained.","triggerScenarios":"Inside introspectInterfaces (and similar buildGenericTypeAwarePropertyDescriptor callers), for each interface PropertyDescriptor Spring rebuilds it as GenericTypeAwarePropertyDescriptor; if the read/write methods cannot be reconciled for the target beanClass, the constructor throws IntrospectionException and Spring wraps it.","commonSituations":"A class implements an interface whose default-method getter/setter has a type incompatible with the implementation, an interface exposing an indexed accessor that doesn't match, or generics erasure causing the descriptor builder to fail to find a consistent property type.","solutions":["Look at the wrapped IntrospectionException cause to find the offending property and its methods.","Make the implementing class's accessors signature-compatible with the interface accessors.","Remove or correct the offending interface accessor (e.g. a setter whose parameter type does not match the getter return type).","Avoid exposing the problematic property through the interface."],"exampleFix":"// before\ninterface IFoo { Number getValue(); void setValue(Integer v); }\nclass Foo implements IFoo { /* value() type clash */ }\nnew BeanWrapperImpl(new Foo());\n\n// after - consistent types\ninterface IFoo { Integer getValue(); void setValue(Integer v); }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static boolean interfaceAccessorsConsistent(Class<?> impl, Class<?> ifc) {\n    try {\n        for (PropertyDescriptor pd : java.beans.Introspector.getBeanInfo(ifc).getPropertyDescriptors()) {\n            if (pd.getReadMethod() != null) impl.getMethod(pd.getReadMethod().getName());\n        }\n        return true;\n    } catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n    new BeanWrapperImpl(bean);\n} catch (FatalBeanException ex) {\n    // cause is IntrospectionException - fix interface accessor mismatch\n    log.error(\"re-introspection failed for {}\", bean.getClass(), ex.getCause());\n}","preventionTips":["Ensure implementation accessors match interface accessor signatures exactly.","Avoid exposing indexed accessors through interfaces unless they conform to JavaBeans rules.","Keep generics consistent between interface and implementation."],"tags":["introspection","bean-wrapper","interface","spring-beans"],"backgroundTag":null,"analyzedSha":"69bf83ad716d0cfc4b0520a19b4d8b24c79d1538","analyzedAt":"2026-08-09T15:32:58.770Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}