{"record":{"id":"df4bdf4e82a93401","repo":"hibernate/hibernate-orm","slug":"could-not-access-given-cfg-xml-url-input-stream","errorCode":null,"errorMessage":"Could not access given cfg.xml URL input stream","messagePattern":"Could not access given cfg\\.xml URL input stream","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/ConfigLoader.java","lineNumber":108,"sourceCode":"\n\tpublic LoadedConfig loadConfigXmlUrl(URL url) {\n\t\ttry {\n\t\t\tfinal var stream = url.openStream();\n\t\t\ttry {\n\t\t\t\treturn LoadedConfig.consume( jaxbProcessorHolder.getValue()\n\t\t\t\t\t\t.unmarshal( stream, new Origin( URL, url.toExternalForm() ) ) );\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\ttry {\n\t\t\t\t\tstream.close();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e) {\n\t\t\t\t\tBOOT_LOGGER.unableToCloseCfgXmlUrlStream( e );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new ConfigurationException( \"Could not access given cfg.xml URL input stream\", e );\n\t\t}\n\t}\n\n\tpublic Properties loadProperties(String resourceName) {\n\t\tfinal var stream = locateStream( resourceName );\n\t\tif ( stream == null ) {\n\t\t\tthrow new ConfigurationException( \"Unable to apply settings from properties file [\" + resourceName + \"]\" );\n\t\t}\n\n\t\ttry {\n\t\t\treturn loadProperties( stream );\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new ConfigurationException( \"Unable to apply settings from properties file [\" + resourceName + \"]\", e );\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tstream.close();","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/ConfigLoader.java#L90-L126","documentation":"Error \"Could not access given cfg.xml URL input stream\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A configuration resource (cfg.xml URL or properties file) cannot be opened or read.","commonSituations":"Unreadable or missing config files, wrong URLs, or IO errors while Hibernate loads settings during bootstrap.","solutions":["Check the URL passed to configure(URL) is reachable and readable (network access, file permissions).","Verify the URL protocol is correct and the resource behind it is not blocked by a firewall or security manager.","Test opening the URL independently (e.g. curl or url.openStream()) to isolate the access problem."],"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"}