{"record":{"id":"0e166d5adb50ed91","repo":"hibernate/hibernate-orm","slug":"specified-cfg-xml-file-s-does-not-exist","errorCode":null,"errorMessage":"Specified cfg.xml file [%s] does not exist","messagePattern":"Specified cfg\\.xml file \\[(.+?)\\] does not exist","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/ConfigLoader.java","lineNumber":80,"sourceCode":"\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tstream.close();\n\t\t\t}\n\t\t\tcatch (IOException e) {\n\t\t\t\tBOOT_LOGGER.unableToCloseCfgXmlResourceStream( e );\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic LoadedConfig loadConfigXmlFile(File cfgXmlFile) {\n\t\ttry ( FileInputStream cfgFileStream = new FileInputStream( cfgXmlFile ) ) {\n\t\t\treturn LoadedConfig.consume( jaxbProcessorHolder.getValue()\n\t\t\t\t\t.unmarshal( cfgFileStream,\n\t\t\t\t\t\t\tnew Origin( FILE, cfgXmlFile.getAbsolutePath() ) ) );\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\tthrow new ConfigurationException(\n\t\t\t\t\t\"Specified cfg.xml file [\" + cfgXmlFile.getAbsolutePath() + \"] does not exist\"\n\t\t\t);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tBOOT_LOGGER.unableToCloseCfgXmlUrlStream( e );\n\t\t}\n\n\t\treturn null;\n\t}\n\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 {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/cfgxml/internal/ConfigLoader.java#L62-L98","documentation":"Error \"Specified cfg.xml file [%s] does not exist\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A hibernate.cfg.xml resource named in the configuration cannot be found.","commonSituations":"Referencing cfg.xml by a wrong classpath path or file path, or the file not being packaged into the deployment.","solutions":["Verify the cfg.xml file path given to configure(File) or configure(String) actually exists on disk.","Use an absolute path or confirm the working directory when using relative paths.","Regenerate or restore the hibernate.cfg.xml file if it was deleted or not deployed."],"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-22T14:17:55.899Z"}