{"record":{"id":"e23cf7b1ea3a1a6c","repo":"hibernate/hibernate-orm","slug":"unable-to-locate-config-file-path","errorCode":null,"errorMessage":"Unable to locate config file: \" + path","messagePattern":"Unable to locate config file: \" \\+ path","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java","lineNumber":93,"sourceCode":"\t\t// Anywhere else we should look?\n\t\treturn url;\n\t}\n\n\t/**\n\t * Open an InputStream to the URL represented by the incoming path.  First makes a call\n\t * to {@link #locateConfig(String)} in order to find an appropriate URL.\n\t * {@link URL#openStream()} is then called to obtain the stream.\n\t *\n\t * @param path The path representing the config location.\n\t *\n\t * @return An input stream to the requested config resource.\n\t *\n\t * @throws HibernateException Unable to open stream to that resource.\n\t */\n\tpublic static InputStream getConfigStream(final String path) throws HibernateException {\n\t\tfinal URL url = locateConfig( path );\n\t\tif ( url == null ) {\n\t\t\tthrow new HibernateException( \"Unable to locate config file: \" + path );\n\t\t}\n\t\ttry {\n\t\t\treturn url.openStream();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new HibernateException( \"Unable to open config file: \" + path, e );\n\t\t}\n\t}\n\n\tprivate ConfigHelper() {\n\t}\n\n\tpublic static InputStream getResourceAsStream(String resource) {\n\t\tfinal String stripped = resource.startsWith( \"/\" )\n\t\t\t\t? resource.substring( 1 )\n\t\t\t\t: resource;\n\n\t\tInputStream stream = null;","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java#L75-L111","documentation":"Error \"Unable to locate config file: \" + path\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/internal/util/ConfigHelper.java:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the config file path/classpath resource exists; correct the path passed to configure()/locateConfig.","Package hibernate.cfg.xml (or the referenced file) on the classpath."],"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"}