hibernate/hibernate-orm · error · BeanIntrospectionException

Unable to determine bean info from class [" + beanClass.getN

Error message

Unable to determine bean info from class [" + beanClass.getName() + "]

What it means

Before your delegate runs, visitBeanInfo must produce a BeanInfo via java.beans.Introspector.getBeanInfo(beanClass, stopClass). If introspection itself throws — classically IntrospectionException for conflicting accessor signatures (getter returns one type, setter takes an unrelated type), or a companion BeanInfo class that fails to load — the outer catch wraps it into BeanIntrospectionException with this message naming the class. Here the failure is the introspection step, not your delegate.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/internal/util/beans/BeanInfoHelper.java:101

			final BeanInfo info = getBeanInfo( beanClass, stopClass );
			try {
				delegate.processBeanInfo( info );
			}
			catch ( RuntimeException e ) {
				throw e;
			}
			catch ( InvocationTargetException e ) {
				throw new BeanIntrospectionException( "Error delegating bean info use", e.getTargetException() );
			}
			catch ( Exception e ) {
				throw new BeanIntrospectionException( "Error delegating bean info use", e );
			}
		}
		catch ( BeanIntrospectionException e ) {
			throw e;
		}
		catch ( Exception e ) {
			throw new BeanIntrospectionException( "Unable to determine bean info from class [" + beanClass.getName() + "]", e );
		}
	}

	public static <T> T visitBeanInfo(Class<?> beanClass, ReturningBeanInfoDelegate<T> delegate) {
		return visitBeanInfo( beanClass, null, delegate );
	}

	public static <T> T visitBeanInfo(Class<?> beanClass, Class<?> stopClass, ReturningBeanInfoDelegate<T> delegate) {
		try {
			final BeanInfo info = getBeanInfo( beanClass, stopClass );
			try {
				return delegate.processBeanInfo( info );
			}
			catch ( RuntimeException e ) {
				throw e;
			}
			catch ( InvocationTargetException e ) {
				throw new BeanIntrospectionException( "Error delegating bean info use", e.getTargetException() );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Read getCause(): IntrospectionException usually names the property whose getter/setter types conflict — align the signatures.
  2. Remove or regenerate stale *BeanInfo companion classes on the classpath.
  3. Verify the stopClass argument excludes exactly the intended superclass and does not cut through a partially exposed property.

Example fix

// before
public class Sample {
    public String getValue() { return value; }
    public void setValue(Integer value) { } // conflicts with String getter -> introspection fails
}

// after
public class Sample {
    private String value;
    public String getValue() { return value; }
    public void setValue(String value) { this.value = value; }
}
Defensive patterns

Strategy: try-catch

Validate before calling

static void preflightIntrospection(Class<?> beanClass, Class<?> stopClass) {
    try {
        java.beans.Introspector.getBeanInfo(beanClass, stopClass);
    } catch (java.beans.IntrospectionException e) {
        throw new IllegalStateException(beanClass.getName() + " is not introspectable: " + e.getMessage(), e);
    }
}

Try / catch

try {
    BeanInfoHelper.visitBeanInfo(beanClass, delegate);
} catch (org.hibernate.internal.util.beans.BeanIntrospectionException e) {
    if (e.getCause() instanceof java.beans.IntrospectionException ie) {
        // ie.getMessage() names the conflicting property; align getter/setter signatures
    }
}

Prevention

When it happens

Trigger: Introspecting a class whose property accessors conflict (e.g., String getFoo() with void setFoo(Integer)), whose custom *BeanInfo class cannot be loaded or instantiated, or passing a stopClass that cuts the hierarchy in an incompatible way.

Common situations: Beans with overloaded setters of unrelated types; stale IDE- or tool-generated BeanInfo classes shipped next to the bean; exotic classloader setups preventing BeanInfo resolution; classes with malformed accessor pairs accumulated over refactors.

Related errors


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/034b9643cff9fd88. Report an issue: GitHub.