{"record":{"id":"59bc7677f5d3b013","repo":"apache/beam","slug":"encountered-an-error-when-constructing-catalog-s","errorCode":null,"errorMessage":"Encountered an error when constructing Catalog '%s'","messagePattern":"Encountered an error when constructing Catalog '(.+?)'","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/catalog/InMemoryCatalogManager.java","lineNumber":128,"sourceCode":"      throw new IllegalStateException(\n          String.format(\n              \"Could not create catalog '%s': \"\n                  + \"expected only one implementation for type '%s' but found %s\",\n              name, type, foundCatalogs.size()));\n    } else if (foundCatalogs.isEmpty()) {\n      throw new UnsupportedOperationException(\n          String.format(\"Could not find type '%s' for catalog '%s'.\", type, name));\n    }\n\n    return foundCatalogs.get(0);\n  }\n\n  private Catalog createCatalogInstance(\n      Class<? extends Catalog> catalogClass, String name, Map<String, String> properties) {\n    try {\n      return catalogClass.getConstructor(String.class, Map.class).newInstance(name, properties);\n    } catch (ReflectiveOperationException e) {\n      throw new RuntimeException(\n          String.format(\"Encountered an error when constructing Catalog '%s'\", name), e);\n    }\n  }\n\n  @Override\n  public Collection<Catalog> catalogs() {\n    return catalogs.values();\n  }\n}\n","sourceCodeStart":110,"sourceCodeEnd":138,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/catalog/InMemoryCatalogManager.java#L110-L138","documentation":"createCatalogInstance wraps reflective instantiation of the resolved Catalog class; any exception thrown by the implementation's constructor (bad properties, missing dependencies) is rethrown as IllegalStateException naming the catalog being constructed. The root cause is the constructor failure, not the catalog type resolution.","triggerScenarios":"Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/catalog/InMemoryCatalogManager.java:128 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped cause: fix the constructor failure (typically invalid catalog properties or a missing dependency).","Validate the properties map against the catalog implementation's expected configuration schema before creating.","Ensure the catalog implementation class can be instantiated with a no-arg/properties constructor in this environment."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}