{"record":{"id":"034b9643cff9fd88","repo":"hibernate/hibernate-orm","slug":"unable-to-determine-bean-info-from-class-bean","errorCode":null,"errorMessage":"Unable to determine bean info from class [\" + beanClass.getName() + \"]","messagePattern":"Unable to determine bean info from class \\[\" \\+ beanClass\\.getName\\(\\) \\+ \"\\]","errorType":"exception","errorClass":"BeanIntrospectionException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/util/beans/BeanInfoHelper.java","lineNumber":101,"sourceCode":"\t\t\tfinal BeanInfo info = getBeanInfo( beanClass, stopClass );\n\t\t\ttry {\n\t\t\t\tdelegate.processBeanInfo( info );\n\t\t\t}\n\t\t\tcatch ( RuntimeException e ) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\tcatch ( InvocationTargetException e ) {\n\t\t\t\tthrow new BeanIntrospectionException( \"Error delegating bean info use\", e.getTargetException() );\n\t\t\t}\n\t\t\tcatch ( Exception e ) {\n\t\t\t\tthrow new BeanIntrospectionException( \"Error delegating bean info use\", e );\n\t\t\t}\n\t\t}\n\t\tcatch ( BeanIntrospectionException e ) {\n\t\t\tthrow e;\n\t\t}\n\t\tcatch ( Exception e ) {\n\t\t\tthrow new BeanIntrospectionException( \"Unable to determine bean info from class [\" + beanClass.getName() + \"]\", e );\n\t\t}\n\t}\n\n\tpublic static <T> T visitBeanInfo(Class<?> beanClass, ReturningBeanInfoDelegate<T> delegate) {\n\t\treturn visitBeanInfo( beanClass, null, delegate );\n\t}\n\n\tpublic static <T> T visitBeanInfo(Class<?> beanClass, Class<?> stopClass, ReturningBeanInfoDelegate<T> delegate) {\n\t\ttry {\n\t\t\tfinal BeanInfo info = getBeanInfo( beanClass, stopClass );\n\t\t\ttry {\n\t\t\t\treturn delegate.processBeanInfo( info );\n\t\t\t}\n\t\t\tcatch ( RuntimeException e ) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\tcatch ( InvocationTargetException e ) {\n\t\t\t\tthrow new BeanIntrospectionException( \"Error delegating bean info use\", e.getTargetException() );","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/util/beans/BeanInfoHelper.java#L83-L119","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read getCause(): IntrospectionException usually names the property whose getter/setter types conflict — align the signatures.","Remove or regenerate stale *BeanInfo companion classes on the classpath.","Verify the stopClass argument excludes exactly the intended superclass and does not cut through a partially exposed property."],"exampleFix":"// before\npublic class Sample {\n    public String getValue() { return value; }\n    public void setValue(Integer value) { } // conflicts with String getter -> introspection fails\n}\n\n// after\npublic class Sample {\n    private String value;\n    public String getValue() { return value; }\n    public void setValue(String value) { this.value = value; }\n}","handlingStrategy":"try-catch","validationCode":"static void preflightIntrospection(Class<?> beanClass, Class<?> stopClass) {\n    try {\n        java.beans.Introspector.getBeanInfo(beanClass, stopClass);\n    } catch (java.beans.IntrospectionException e) {\n        throw new IllegalStateException(beanClass.getName() + \" is not introspectable: \" + e.getMessage(), e);\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    BeanInfoHelper.visitBeanInfo(beanClass, delegate);\n} catch (org.hibernate.internal.util.beans.BeanIntrospectionException e) {\n    if (e.getCause() instanceof java.beans.IntrospectionException ie) {\n        // ie.getMessage() names the conflicting property; align getter/setter signatures\n    }\n}","preventionTips":["Keep getter/setter signature pairs type-consistent on beans fed to introspection.","Delete stale generated *BeanInfo companion classes from build artifacts.","Run a preflight Introspector.getBeanInfo check when loading plugin-style beans at runtime."],"tags":["hibernate","beans","introspection","javabean"],"backgroundTag":"bean-introspection-failure","analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}