{"record":{"id":"4d3c16a554e20b32","repo":"hibernate/hibernate-orm","slug":"unable-to-load-schema-s","errorCode":null,"errorMessage":"Unable to load schema [%s]","messagePattern":"Unable to load schema \\[(.+?)\\]","errorType":"exception","errorClass":"XsdException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/JaxbCfgProcessor.java","lineNumber":166,"sourceCode":"\t}\n\n\tprivate Schema resolveLocalSchema(String schemaName) {\n\t\treturn resolveLocalSchema( schemaName, W3C_XML_SCHEMA_NS_URI );\n\t}\n\n\tprivate Schema resolveLocalSchema(String schemaName, String schemaLanguage) {\n\t\tfinal URL url = classLoaderService.locateResource( schemaName );\n\t\tif ( url == null ) {\n\t\t\tthrow new XsdException( \"Unable to locate schema [\" + schemaName + \"] via classpath\", schemaName );\n\t\t}\n\t\ttry {\n\t\t\tfinal var schemaStream = url.openStream();\n\t\t\ttry {\n\t\t\t\treturn SchemaFactory.newInstance( schemaLanguage )\n\t\t\t\t\t\t.newSchema( new StreamSource( url.openStream() ) );\n\t\t\t}\n\t\t\tcatch ( SAXException | IOException e ) {\n\t\t\t\tthrow new XsdException( \"Unable to load schema [\" + schemaName + \"]\", e, schemaName );\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tschemaStream.close();\n\t\t\t\t}\n\t\t\t\tcatch ( IOException e ) {\n\t\t\t\t\tJAXB_LOGGER.problemClosingSchemaStream( e.toString() );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch ( IOException e ) {\n\t\t\tthrow new XsdException( \"Stream error handling schema url [\" + url.toExternalForm() + \"]\", schemaName );\n\t\t}\n\t}\n\n\tstatic class ContextProvidingValidationEventHandler implements ValidationEventHandler {\n\t\tprivate int lineNumber;\n\t\tprivate int columnNumber;","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/JaxbCfgProcessor.java#L148-L184","documentation":"Error \"Unable to load schema [%s]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"The XSD schema used to validate the configuration cannot be located or loaded.","commonSituations":"Custom schema resolution failing because the schema resource is missing from the classpath or the schema URL is unreachable.","solutions":["Check that the XSD file is readable and not corrupted inside the deployed jar.","Verify XML parser (SAX) availability and version compatibility on the classpath.","Review the causal exception for I/O or parse errors in the schema itself."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}