{"record":{"id":"936b22418101a3c2","repo":"JetBrains/intellij-community","slug":"error-loading-beaninfo-for-component-classname","errorCode":null,"errorMessage":"Error loading BeanInfo for component {className}: {reason}","messagePattern":"Error loading BeanInfo for component (.+?): (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/CompiledClassPropertiesProvider.java","lineNumber":49,"sourceCode":"\n    if (Utils.validateJComponentClass(myLoader, className, false) != null) {\n      return null;\n    }\n\n    final Class<?> aClass;\n    try {\n      aClass = Class.forName(className, false, myLoader);\n    }\n    catch (final ClassNotFoundException exc) {\n      throw new RuntimeException(exc.toString()); // should never happen\n    }\n\n    final BeanInfo beanInfo;\n    try {\n      beanInfo = Introspector.getBeanInfo(aClass);\n    }\n    catch (Throwable e) {\n      throw new RuntimeException(\"Error loading BeanInfo for component \" + className + \": \" + e.getMessage(), e);\n    }\n\n    final HashMap<String, LwIntrospectedProperty> result = new HashMap<>();\n    final PropertyDescriptor[] descriptors = beanInfo.getPropertyDescriptors();\n    for (final PropertyDescriptor descriptor : descriptors) {\n      final Method readMethod = descriptor.getReadMethod();\n      final Method writeMethod = descriptor.getWriteMethod();\n      final Class<?> propertyType = descriptor.getPropertyType();\n      if (writeMethod == null || readMethod == null || propertyType == null) {\n        continue;\n      }\n\n      final String name = descriptor.getName();\n\n      final LwIntrospectedProperty property = propertyFromClass(propertyType, name);\n\n      if (property != null) {\n        property.setDeclaringClassName(descriptor.getReadMethod().getDeclaringClass().getName());","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/lw/CompiledClassPropertiesProvider.java#L31-L67","documentation":"Thrown by CompiledClassPropertiesProvider when java.beans.Introspector.getBeanInfo(componentClass) raises any Throwable while introspecting a component class to discover its bindable properties. The forms tooling relies on Java Bean introspection to list readable/writable properties of Swing and custom components; if introspection itself fails (not merely returns no descriptors), it is rethrown as a RuntimeException naming the component class and the underlying reason.","triggerScenarios":"Calling the properties provider on a component class whose BeanInfo cannot be produced: the class has getter/setter methods that throw during introspection, a custom BeanInfo class that fails to load or instantiate, or introspection hits a LinkageError/RuntimeException. Any Throwable from Introspector.getBeanInfo lands in this catch.","commonSituations":"Custom component with a buggy static initializer touched by introspection; a custom XBeanInfo class on the classpath that throws in its constructor; classpath pollution where a partially compiled component class is introspected; running the forms compiler in an environment (e.g. build server) with a different JDK whose Introspector behavior differs.","solutions":["Check the wrapped exception (cause) after the reason text — it identifies whether the failure is in a custom BeanInfo, a static initializer, or introspection itself.","Fix or remove the custom BeanInfo class for the component (a malformed <Class>BeanInfo class is the most common culprit).","Simplify the component's getter/setter signatures so the Introspector can process them without invoking user code.","If the class is not meant to be a designer component, stop referencing it in .form files."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { provider.getIntrospectedProperties(className); } catch (RuntimeException e) { if (e.getMessage() != null && e.getMessage().startsWith(\"Error loading BeanInfo\")) { /* inspect e.getCause(): custom BeanInfo or initializer failure */ skipComponent(className); } else throw e; }","preventionTips":["Keep custom BeanInfo classes simple and side-effect free.","Avoid static initializers in designer components that can throw.","Test custom components in a plain Introspector.getBeanInfo call before using them in forms."],"tags":["gui-designer","bean-introspection","custom-components","runtime-exception"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}