{"record":{"id":"1e9b37e7609b189c","repo":"apache/beam","slug":"standard-logical-type-s-does-not-have-a-static-of-s-method","errorCode":null,"errorMessage":"Standard logical type '%s' does not have a static of('%s') method.","messagePattern":"Standard logical type '(.+?)' does not have a static of\\('(.+?)'\\) method\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/SchemaTranslation.java","lineNumber":427,"sourceCode":"              clazz = ClassUtils.wrapperToPrimitive(clazz);\n            } else if (fieldValue instanceof List) {\n              // argument is ArrayValue or iterableValue\n              clazz = List.class;\n            }\n            if (fieldValue instanceof Map) {\n              // argument is Map\n              clazz = Map.class;\n            } else if (fieldValue instanceof Row) {\n              // argument is Row\n              clazz = Row.class;\n            }\n            String objectName = clazz.getName();\n            try {\n              return FieldType.logicalType(\n                  logicalTypeClass.cast(\n                      logicalTypeClass.getMethod(\"of\", clazz).invoke(null, fieldValue)));\n            } catch (NoSuchMethodException e) {\n              throw new RuntimeException(\n                  String.format(\n                      \"Standard logical type '%s' does not have a static of('%s') method.\",\n                      urn, objectName),\n                  e);\n            } catch (IllegalAccessException e) {\n              throw new RuntimeException(\n                  String.format(\n                      \"Standard logical type '%s' has an of('%s') method, but it is not accessible.\",\n                      urn, objectName),\n                  e);\n            } catch (InvocationTargetException e) {\n              throw new RuntimeException(\n                  String.format(\n                      \"Error instantiating logical type '%s' with of('%s') method.\",\n                      urn, objectName),\n                  e);\n            }\n          } else {","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/SchemaTranslation.java#L409-L445","documentation":"When decoding a standard logical type (identified by URN) that takes an argument, SchemaTranslation reflectively invokes the static of(bootstrapValue) method; if the class has no such static method it throws RuntimeException with 'does not have a static of(...) method'.","triggerScenarios":"Decoding a LogicalType field whose URN maps to a class lacking a static of(<argumentType>) factory, or whose argument type does not match of()'s parameter.","commonSituations":"Custom LogicalType implementations serialized across jobs; renamed/refactored factory methods; argument type changed (e.g. string vs enum) between writer and reader versions.","solutions":["Add/restore a public static of(<argType>) method on the logical type class matching the serialized argument type.","Ensure the URN-to-class mapping (LogicalTypes registrar) points to the right class.","Make the logical type implement the same interface/version as when encoded; align SDK versions.","Catch the RuntimeException around schema/row decode and fail gracefully per record."],"exampleFix":"// before\nclass MyLogicalType { public MyLogicalType(String v){...} }\n// after\nclass MyLogicalType implements LogicalType<String,String> {\n  public static MyLogicalType of(String v){ return new MyLogicalType(v); }\n}","handlingStrategy":"validation","validationCode":"Class<?> lt = logicalTypeClass;\nboolean ok = java.util.Arrays.stream(lt.getMethods())\n    .anyMatch(m -> m.getName().equals(\"of\") && m.getParameterCount() == 1\n        && java.lang.reflect.Modifier.isStatic(m.getModifiers()));\nif (!ok) throw new IllegalStateException(\"Logical type missing static of()\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide a public static of(arg) factory in argumented logical types.","Keep factory method signatures stable across versions.","Register logical types via LogicalTypes registrar so URNs map correctly.","Add unit tests that round-trip logical types through proto form."],"tags":["java","apache-beam","reflection","logical-type"],"backgroundTag":"missing-method","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"}