spring-projects/spring-framework · error · FatalBeanException
Failed to re-introspect class
Error message
Failed to re-introspect class [{beanClass.getName()}] What it means
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.
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.
Example fix
// before
interface IFoo { Number getValue(); void setValue(Integer v); }
class Foo implements IFoo { /* value() type clash */ }
new BeanWrapperImpl(new Foo());
// after - consistent types
interface IFoo { Integer getValue(); void setValue(Integer v); } Defensive patterns
Strategy: try-catch
Type guard
static boolean interfaceAccessorsConsistent(Class<?> impl, Class<?> ifc) {
try {
for (PropertyDescriptor pd : java.beans.Introspector.getBeanInfo(ifc).getPropertyDescriptors()) {
if (pd.getReadMethod() != null) impl.getMethod(pd.getReadMethod().getName());
}
return true;
} catch (Exception e) { return false; }
} Try / catch
try {
new BeanWrapperImpl(bean);
} catch (FatalBeanException ex) {
// cause is IntrospectionException - fix interface accessor mismatch
log.error("re-introspection failed for {}", bean.getClass(), ex.getCause());
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Failed to obtain BeanInfo for class
- Bad indexed read method arg count
- Bad indexed write method arg count
- Bad read method arg count
- Bad write method arg count
AI-assisted analysis of spring-projects/spring-framework@69bf83ad71 (2026-08-09).
Data as JSON: /api/errors/3f2bef6fde728231.
Report an issue: GitHub.
Appendix: source
Thrown at spring-beans/src/main/java/org/springframework/beans/CachedIntrospectionResults.java:400
pd = this.propertyDescriptors.get(StringUtils.uncapitalize(name));
if (pd == null) {
pd = this.propertyDescriptors.get(StringUtils.capitalize(name));
}
}
return pd;
}
PropertyDescriptor[] getPropertyDescriptors() {
return this.propertyDescriptors.values().toArray(PropertyDescriptorUtils.EMPTY_PROPERTY_DESCRIPTOR_ARRAY);
}
private PropertyDescriptor buildGenericTypeAwarePropertyDescriptor(Class<?> beanClass, PropertyDescriptor pd) {
try {
return new GenericTypeAwarePropertyDescriptor(beanClass, pd.getName(), pd.getReadMethod(),
pd.getWriteMethod(), pd.getPropertyEditorClass());
}
catch (IntrospectionException ex) {
throw new FatalBeanException("Failed to re-introspect class [" + beanClass.getName() + "]", ex);
}
}
}
View on GitHub (pinned to 69bf83ad71)