{"record":{"id":"439b879adedf6445","repo":"apache/beam","slug":"class-s-missing-a-property-named-s","errorCode":null,"errorMessage":"Class %s missing a property named '%s'.","messagePattern":"Class (.+?) missing a property named '(.+?)'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java","lineNumber":1894,"sourceCode":"            Stream.concat(getRegisteredOptions().stream(), Stream.of(klass))\n                .collect(Collectors.toSet()));\n    for (PropertyDescriptor descriptor : propertyDescriptors) {\n      propertyNamesToGetters.put(descriptor.getName(), descriptor.getReadMethod());\n    }\n    Map<String, Object> convertedOptions = Maps.newHashMap();\n    for (final Map.Entry<String, Collection<String>> entry : options.asMap().entrySet()) {\n      try {\n        // Search for close matches for missing properties.\n        // Either off by one or off by two character errors.\n        if (!propertyNamesToGetters.containsKey(entry.getKey())) {\n          SortedSet<String> closestMatches =\n              new TreeSet<>(\n                  Sets.filter(\n                      propertyNamesToGetters.keySet(),\n                      input -> StringUtils.getLevenshteinDistance(entry.getKey(), input) <= 2));\n          switch (closestMatches.size()) {\n            case 0:\n              throw new IllegalArgumentException(\n                  String.format(\"Class %s missing a property named '%s'.\", klass, entry.getKey()));\n            case 1:\n              throw new IllegalArgumentException(\n                  String.format(\n                      \"Class %s missing a property named '%s'. Did you mean '%s'?\",\n                      klass, entry.getKey(), Iterables.getOnlyElement(closestMatches)));\n            default:\n              throw new IllegalArgumentException(\n                  String.format(\n                      \"Class %s missing a property named '%s'. Did you mean one of %s?\",\n                      klass, entry.getKey(), closestMatches));\n          }\n        }\n        Method method = propertyNamesToGetters.get(entry.getKey());\n        // Only allow empty argument values for String, String Array, and\n        // Collection<String>.\n        Class<?> returnType = method.getReturnType();\n        JavaType type = MAPPER.getTypeFactory().constructType(method.getGenericReturnType());","sourceCodeStart":1876,"sourceCodeEnd":1912,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/options/PipelineOptionsFactory.java#L1876-L1912","documentation":"A value was supplied for an option property name that does not exist on the target PipelineOptions class, and no existing property is within Levenshtein distance 2 of the given name. Beam throws IllegalArgumentException during CLI/JSON option parsing.","triggerScenarios":"Calling PipelineOptionsFactory.fromArgs(\"--propName=value\").as(...) or setting a JSON map key where no property named propName exists on the options class and no close match is found.","commonSituations":"Typo in the --flag name on the command line; renamed option property in a newer Beam version; case mismatch in the property name.","solutions":["Correct the property name to exactly match a getter-derived property on the options class","Run with --help=<class> to list valid properties for that options class","Check for case/typo differences against the interface's getter names"],"exampleFix":"// before\nPipelineOptionsFactory.fromArgs(\"--jobNmae=myjob\").as(MyOptions.class);\n// after\nPipelineOptionsFactory.fromArgs(\"--jobName=myjob\").as(MyOptions.class);","handlingStrategy":"validation","validationCode":"Set<String> props = PropertyNames.methodToPropertyName(MyOptions.class.getMethods());\nif (!props.contains(\"jobName\")) throw new IllegalArgumentException(\"unknown option jobName; valid: \" + props);","typeGuard":null,"tryCatchPattern":"try { PipelineOptionsFactory.fromArgs(args).as(MyOptions.class); } catch (IllegalArgumentException e) { log.error(\"Bad option flag: {}\", e.getMessage()); }","preventionTips":["List properties with --help=<class> before scripting flags","Keep flag names in constants shared with the code that reads them","Pin Beam version to avoid silent property renames"],"tags":["java","apache-beam","cli","pipeline-options","typo"],"backgroundTag":"invalid-cli-argument","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"}