{"record":{"id":"bfd6a0b096225d56","repo":"apache/beam","slug":"cannot-create-creator-for-targettypedescriptor","errorCode":null,"errorMessage":"Cannot create creator for ${targetTypeDescriptor}","messagePattern":"Cannot create creator for (.+?)","errorType":"exception","errorClass":"java.lang.RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoMessageSchema.java","lineNumber":122,"sourceCode":"        new ProtoClassFieldValueTypeSupplier(),\n        new ProtoTypeConversionsFactory());\n  }\n\n  @Override\n  public List<FieldValueTypeInformation> fieldValueTypeInformations(\n      TypeDescriptor<?> targetTypeDescriptor, Schema schema) {\n    return JavaBeanUtils.getFieldTypes(\n        targetTypeDescriptor, schema, new ProtoClassFieldValueTypeSupplier());\n  }\n\n  @Override\n  public SchemaUserTypeCreator schemaTypeCreator(\n      TypeDescriptor<?> targetTypeDescriptor, Schema schema) {\n    SchemaUserTypeCreator creator =\n        ProtoByteBuddyUtils.getBuilderCreator(\n            targetTypeDescriptor, schema, new ProtoClassFieldValueTypeSupplier());\n    if (creator == null) {\n      throw new RuntimeException(\"Cannot create creator for \" + targetTypeDescriptor);\n    }\n    return creator;\n  }\n\n  // Other modules are not allowed to use non-vendored Message class\n  @SuppressWarnings({\n    \"rawtypes\", // TODO(https://github.com/apache/beam/issues/20447)\n    \"unchecked\"\n  })\n  public static <T> SimpleFunction<byte[], Row> getProtoBytesToRowFn(Class<T> clazz) {\n    Class<Message> protoClass = ensureMessageType(clazz);\n    ProtoCoder<Message> protoCoder = ProtoCoder.of(protoClass);\n    return RowMessages.bytesToRowFn(\n        new ProtoMessageSchema(),\n        TypeDescriptor.of(protoClass),\n        bytes -> protoCoder.getParser().parseFrom(bytes));\n  }\n","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/protobuf/src/main/java/org/apache/beam/sdk/extensions/protobuf/ProtoMessageSchema.java#L104-L140","documentation":"ProtoMessageSchema.schemaTypeCreator builds a ByteBuddy-based creator to instantiate proto builder objects for Row conversion. If ProtoByteBuddyUtils.getBuilderCreator returns null — meaning no suitable builder creator could be generated for the target type/schema — this RuntimeException is thrown.","triggerScenarios":"Calling schemaTypeCreator (via Schema translation for a proto class) where the target type has no matching protobuf builder type for the schema fields, e.g. unsupported field types or a type that is not a generated message with a Builder.","commonSituations":"Using ProtoMessageSchema with classes that don't follow generated protobuf code conventions; proto field types unsupported by Beam's schema mapping; ByteBuddy unable to generate the proxy due to classloader/JDK module restrictions.","solutions":["Verify the target type is a protobuf-generated Message with a Builder class.","Check for proto field types unsupported by Beam's proto-to-Row mapping and simplify/annotate them.","Regenerate proto code with a compatible protoc version.","Enable ByteBuddy access to JDK internals (--add-opens) if running on newer JDKs."],"exampleFix":"// before\nschemaRegistry.registerTypeDescriptor(SomeNonProtoPojo.class);\n// after\nschemaRegistry.registerTypeDescriptor(MyGeneratedProtoMessage.class);","handlingStrategy":"try-catch","validationCode":"if (!GeneratedMessageV3.Builder.class.isAssignableFrom(builderClass)) {\n  throw new IllegalArgumentException(\"no builder for \" + targetTypeDescriptor);\n}","typeGuard":null,"tryCatchPattern":"try { creator = schema.schemaTypeCreator(type, schema); } catch (RuntimeException e) { log.error(\"builder creator failed for {}: {}\", type, e.getMessage(), e); }","preventionTips":["Only register generated protobuf messages with ProtoMessageSchema.","Avoid unsupported proto field types in schema-converted messages.","Regenerate protos with compatible protoc versions.","Verify ByteBuddy compatibility with the target JDK."],"tags":["java","protobuf","schema","bytebuddy"],"backgroundTag":"schema-validation-failed","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"}