{"record":{"id":"8c6ef2ae68076ec2","repo":"JetBrains/intellij-community","slug":"class-not-found","errorCode":null,"errorMessage":"Class not found: ","messagePattern":"Class not found: ","errorType":"validation","errorClass":"CodeGenerationException","httpStatus":null,"severity":"error","filePath":"java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java","lineNumber":244,"sourceCode":"\n  public byte[] getPatchedData() {\n    return myPatchedData;\n  }\n\n  static void pushPropValue(GeneratorAdapter generator, String propertyClass, Object value) {\n    PropertyCodeGenerator codeGen = myPropertyCodeGenerators.get(propertyClass);\n    if (codeGen == null) {\n      throw new RuntimeException(\"Unknown property class \" + propertyClass);\n    }\n    codeGen.generatePushValue(generator, value);\n  }\n\n  static InstrumentationClassFinder.PseudoClass getComponentClass(String className, final InstrumentationClassFinder finder) throws CodeGenerationException {\n    try {\n      return finder.loadClass(className);\n    }\n    catch (ClassNotFoundException e) {\n      throw new CodeGenerationException(null, \"Class not found: \" + className);\n    }\n    catch(UnsupportedClassVersionError e) {\n      throw new CodeGenerationException(null, \"Unsupported class version error: \" + className);\n    }\n    catch (IOException e) {\n      throw new CodeGenerationException(null, e.getMessage(), e);\n    }\n  }\n\n  public static Type typeFromClassName(final String className) {\n    return Type.getType(\"L\" + className.replace('.', '/') + \";\");\n  }\n\n  class FormClassVisitor extends ClassVisitor implements GetFontMethodProvider {\n    private String myClassName;\n    private String mySuperName;\n    private final Map<String, String> myFieldDescMap = new HashMap<>();\n    private final Map<String, Integer> myFieldAccessMap = new HashMap<>();","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/AsmCodeGenerator.java#L226-L262","documentation":"AsmCodeGenerator.getComponentClass catches ClassNotFoundException from InstrumentationClassFinder.loadClass and rethrows it as CodeGenerationException('Class not found: ' + className). The GUI Forms bytecode generator could not locate a component class on the instrumentation classpath while compiling a .form.","triggerScenarios":"Compiling/instrumenting a form whose component (or a class referenced by it, e.g. a custom bean or nested form's class) is not on the finder's classpath: missing dependency JAR, class not yet compiled, wrong class name in the .form XML.","commonSituations":"Building a module before its dependencies; custom Swing components in a library not added to the module dependencies; obfuscated/renamed classes after a refactor; forms referencing classes moved to another module; running instrumentation with a stale compile output.","solutions":["Add the missing library/module dependency so the component class is on the compile classpath","Rebuild the module containing the component (class may simply not be compiled yet); a full Rebuild often clears it","Fix the class name in the .form file if the component was renamed/moved (check the form XML's component class attribute)","If it appears only after upgrades, clear build caches (System|Local History unrelated; use File > Invalidate Caches) and rebuild"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try { Class.forName(className, false, loader); } catch (ClassNotFoundException e) { /* resolve dependency before compiling forms */ }","typeGuard":null,"tryCatchPattern":"catch (CodeGenerationException e) if message starts with 'Class not found:': read the class name, verify module dependencies, then rebuild","preventionTips":["Declare every custom component library as a module dependency before authoring forms","Build dependent modules first (or use full Rebuild) when forms reference sibling-module classes","Run rename refactoring (not text edits) so form XML class references stay valid"],"tags":["gui-designer","forms","classloading","build","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}