{"record":{"id":"7c8606149c6df38f","repo":"apache/hadoop","slug":"check-parser-configuration","errorCode":null,"errorMessage":"Check parser configuration","messagePattern":"Check parser configuration","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java","lineNumber":1987,"sourceCode":"          }\n        } catch (UnsupportedEncodingException e) {\n          throw new InvalidAbfsRestOperationException(e);\n        }\n        metadataRequestHeaders.add(new AbfsHttpHeader(key, value));\n      }\n    }\n    return metadataRequestHeaders;\n  }\n\n  private final ThreadLocal<SAXParser> saxParserThreadLocal = ThreadLocal.withInitial(() -> {\n    SAXParserFactory factory = SAXParserFactory.newInstance();\n    factory.setNamespaceAware(true);\n    try {\n      return factory.newSAXParser();\n    } catch (SAXException e) {\n      throw new RuntimeException(\"Unable to create SAXParser\", e);\n    } catch (ParserConfigurationException e) {\n      throw new RuntimeException(\"Check parser configuration\", e);\n    }\n  });\n\n  /**\n   * This will filter out all the rename pending json files in listing output.\n   * @param listResultSchema List of entries returned by Blob Endpoint.\n   * @param uri URI to be used for path conversion.\n   * @return List of entries after removing duplicates.\n   * @throws IOException if path conversion fails.\n   */\n  @VisibleForTesting\n  public ListResponseData filterRenamePendingFiles(\n      BlobListResultSchema listResultSchema, URI uri) throws IOException {\n    List<VersionedFileStatus> fileStatuses = new ArrayList<>();\n    Map<Path, Integer> renamePendingJsonPaths = new HashMap<>();\n\n    for (BlobListResultEntrySchema entry : listResultSchema.paths()) {\n      if (isRenamePendingJsonPathEntry(entry)) {","sourceCodeStart":1969,"sourceCodeEnd":2005,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java#L1969-L2005","documentation":"A RuntimeException from the same per-thread SAXParser initializer: SAXParserFactory.newSAXParser() threw ParserConfigurationException. The configured parser factory exists but rejects the requested configuration (namespace-aware), so no parser can be built for XML parsing of blob-endpoint responses.","triggerScenarios":"First blob-endpoint XML-listing call on a thread where the resolved SAXParserFactory does not support the namespace-aware setting — a custom or partial parser implementation chosen via system property, service-loader entry, or classpath conflict.","commonSituations":"A JAXP system property or services file selects a parser that lacks namespace support; minimal/partial XML parser jars shipped by a framework; embedding Hadoop in a container that already pins a limited parser.","solutions":["Check for and remove -Djavax.xml.parsers.SAXParserFactory and -Dorg.xml.sax.driver overrides or point them at a full-featured implementation.","Ensure the classpath contains one complete parser implementation (e.g. the JDK built-in or modern Xerces) and no partial duplicates.","Validate at startup that SAXParserFactory.newInstance().newSAXParser() succeeds with factory.setNamespaceAware(true).","If shading, keep the original JAXP service descriptors intact."],"exampleFix":"// before: JVM launched with\n//   -Djavax.xml.parsers.SAXParserFactory=com.example.MinimalSAXFactory\n// after: launch without the override, or point at a namespace-aware implementation\nSAXParserFactory f = SAXParserFactory.newInstance();\nf.setNamespaceAware(true);\nf.newSAXParser(); // must not throw before Azure work starts","handlingStrategy":"try-catch","validationCode":"SAXParserFactory f = SAXParserFactory.newInstance();\nf.setNamespaceAware(true);\ntry { f.newSAXParser(); }\ncatch (Exception e) { throw new IllegalStateException(\"JAXP parser rejects namespace-aware config\", e); }","typeGuard":null,"tryCatchPattern":"try {\n  return blobClient.listContainers(prefix, token, tracingContext);\n} catch (RuntimeException ex) {\n  if (ex.getCause() instanceof ParserConfigurationException) {\n    // JAXP factory selection is broken: audit system properties and classpath\n  }\n  throw ex;\n}","preventionTips":["Avoid JAXP factory system-property overrides on nodes running Hadoop Azure.","Pin a known-good parser version in the distribution and fail builds that introduce a second one.","Self-test namespace-aware parser creation during cluster validation."],"tags":["azure","abfs","xml","sax","jaxp","parser-config"],"backgroundTag":"xml-parser-configuration","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}