{"record":{"id":"00b0b961669658bf","repo":"apache/hadoop","slug":"error-parsing-resource-xinclude-is-not-support","errorCode":null,"errorMessage":"Error parsing resource {}: XInclude is not supported for restricted resources","messagePattern":"Error parsing resource (.+?): XInclude is not supported for restricted resources","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java","lineNumber":3298,"sourceCode":"      }\n    }\n\n    private void handleInclude() throws XMLStreamException, IOException {\n      // Determine href for xi:include\n      confInclude = null;\n      int attrCount = reader.getAttributeCount();\n      List<ParsedItem> items;\n      for (int i = 0; i < attrCount; i++) {\n        String attrName = reader.getAttributeLocalName(i);\n        if (\"href\".equals(attrName)) {\n          confInclude = reader.getAttributeValue(i);\n        }\n      }\n      if (confInclude == null) {\n        return;\n      }\n      if (isRestricted) {\n        throw new RuntimeException(\"Error parsing resource \" + wrapper\n            + \": XInclude is not supported for restricted resources\");\n      }\n      // Determine if the included resource is a classpath resource\n      // otherwise fallback to a file resource\n      // xi:include are treated as inline and retain current source\n      URL include = getResource(confInclude);\n      if (include != null) {\n        Resource classpathResource = new Resource(include, name,\n            wrapper.isParserRestricted());\n        // This is only called recursively while the lock is already held\n        // by this thread, but synchronizing avoids a findbugs warning.\n        synchronized (Configuration.this) {\n          XMLStreamReader2 includeReader =\n              getStreamReader(classpathResource, quiet);\n          if (includeReader == null) {\n            throw new RuntimeException(classpathResource + \" not found\");\n          }\n          items = new Parser(includeReader, classpathResource, quiet).parse();","sourceCodeStart":3280,"sourceCodeEnd":3316,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L3280-L3316","documentation":"Error \"Error parsing resource {}: XInclude is not supported for restricted resources\" thrown in apache/hadoop.","triggerScenarios":"Raised at runtime when the documented precondition or configuration requirement for this operation is violated.","commonSituations":"Misconfigured or missing property, invalid user input, or calling the API before its prerequisites are met.","solutions":["Remove XInclude directives from configuration resources loaded from restricted (non-file) sources."],"exampleFix":"Inline the included content instead of using xi:include.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}