{"record":{"id":"99e98f6f04bdc05e","repo":"apache/beam","slug":"autovalue-generated-class-not-found-generatedclassname","errorCode":null,"errorMessage":"AutoValue generated class not found: ${generatedClassName}","messagePattern":"AutoValue generated class not found: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java","lineNumber":111,"sourceCode":"      TypeDescriptor<?> typeDescriptor) {\n    if (!typeDescriptor.getRawType().getName().contains(AUTO_VALUE_GENERATED_PREFIX)) {\n      // fast path for types which aren't autogenerated\n      return typeDescriptor;\n    }\n    // AutoValue extensions may be nested\n    TypeDescriptor<?> firstGeneratedTypeDescriptor = findFirstGeneratedAutoValue(typeDescriptor);\n    return Optional.ofNullable(firstGeneratedTypeDescriptor.getRawType().getSuperclass())\n        .map(superClass -> firstGeneratedTypeDescriptor.getSupertype((Class) superClass))\n        .orElse(null);\n  }\n\n  @SuppressWarnings(\"unchecked\")\n  public static TypeDescriptor<?> getAutoValueGenerated(TypeDescriptor<?> typeDescriptor) {\n    String generatedClassName = getAutoValueGeneratedName(typeDescriptor.getRawType().getName());\n    try {\n      return typeDescriptor.getSubtype((Class) Class.forName(generatedClassName));\n    } catch (ClassNotFoundException e) {\n      throw new IllegalStateException(\"AutoValue generated class not found: \" + generatedClassName);\n    }\n  }\n\n  public static @Nullable TypeDescriptor<?> getAutoValueGeneratedBuilder(\n      TypeDescriptor<?> typeDescriptor) {\n    TypeDescriptor generated = getAutoValueGenerated(typeDescriptor);\n    TypeDescriptor firstGenerated = findFirstGeneratedAutoValue(generated);\n    String builderName = firstGenerated.getRawType().getName() + \"$Builder\";\n    try {\n      Class builderClass = Class.forName(builderName);\n      Type genericSuperClass = builderClass.getGenericSuperclass();\n      if (builderClass.getTypeParameters().length != 0 && genericSuperClass != null) {\n        // we need to get hold of a parameterized type version of the builder class - here's one way\n        // of doing it:\n        TypeDescriptor resolved = TypeDescriptor.of(genericSuperClass).getSubtype(builderClass);\n        for (int i = 0; i < builderClass.getTypeParameters().length; i++) {\n          TypeVariable typeVariable = builderClass.getTypeParameters()[i];\n          Type actualType =","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AutoValueUtils.java#L93-L129","documentation":"AutoValueUtils maps a user @AutoValue class to its AutoValue-generated implementation class by name convention (AutoValue_<...>). getAutoValueGenerated loads that class reflectively and throws IllegalStateException when Class.forName cannot find the generated class — typically because annotation processing didn't run or the generated class isn't on the runtime classpath.","triggerScenarios":"Calling getAutoValueGenerated (directly or via generated/generatedTypeDescriptor) on a TypeDescriptor whose raw type is an @AutoValue class for which no AutoValue_... class exists at runtime.","commonSituations":"Building with annotation processing disabled (e.g. -proc:none); AutoValue dependency missing from the annotation processor path; shaded/prod jar that stripped generated classes; running in an environment where the generated class was compiled in a different artifact.","solutions":["Ensure AutoValue annotation processing is enabled in the build (remove -proc:none, configure the annotationProcessorPath)","Add com.google.auto.value:auto-value to the annotationProcessorPath/processor path","Verify the AutoValue_<Class> class exists in the deployed artifact","Use beam-sdks-java-extensions-avro/autovalue service-compatible Beam version and check shading includes generated classes"],"exampleFix":"// before\n<annotationProcessorPaths><!-- autovalue missing --></annotationProcessorPaths>\n// after\n<annotationProcessorPaths>\n  <path><groupId>com.google.auto.value</groupId><artifactId>auto-value</artifactId><version>1.10.4</version></path>\n</annotationProcessorPaths>","handlingStrategy":"try-catch","validationCode":"try { Class.forName(\"AutoValue_\" + type.getRawType().getName()); }\ncatch (ClassNotFoundException e) { throw new IllegalStateException(\"AutoValue processing not enabled for \" + type); }","typeGuard":"boolean hasAutoValueGenerated(Class<?> c) {\n  try { Class.forName(\"AutoValue_\" + c.getName()); return true; } catch (ClassNotFoundException e) { return false; }\n}","tryCatchPattern":"try { TypeDescriptor<?> g = AutoValueUtils.getAutoValueGenerated(td); }\ncatch (IllegalStateException e) { /* fall back to reflection/manual schema */ }","preventionTips":["Enable AutoValue annotation processing in all build profiles","Verify generated classes survive shading/minification","Add a build-time check that AutoValue_ classes exist"],"tags":["java","apache-beam","autovalue","classpath"],"backgroundTag":"class-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}