{"record":{"id":"7f407defab6b77c9","repo":"hibernate/hibernate-orm","slug":"unable-to-convert-jar-file-to-url-jarfilereferen-7f407d","errorCode":null,"errorMessage":"Unable to convert jar File to URL [<jarFileReference>]","messagePattern":"Unable to convert jar File to URL \\[<jarFileReference>\\]","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ExplodedArchiveDescriptor.java","lineNumber":229,"sourceCode":"\t\t\t}\n\t\t\tcatch (MalformedURLException e) {\n\t\t\t\tthrow new ArchiveException( \"Unable to convert relative <jar-file/> reference to URL [\" + jarFileReference + \"]\", e );\n\t\t\t}\n\t\t}\n\n\t\tvar standardResolution = ArchiveHelper.standardJarFileReferenceResolution( jarFileReference, archiveDescriptorFactory );\n\t\tif ( standardResolution != null ) {\n\t\t\treturn standardResolution;\n\t\t}\n\n\t\ttry {\n\t\t\tvar file = new File( resolveRootDirectory(), jarFileReference );\n\t\t\tif ( file.exists() ) {\n\t\t\t\treturn archiveDescriptorFactory.buildArchiveDescriptor( file.toURI().toURL() );\n\t\t\t}\n\t\t}\n\t\tcatch (MalformedURLException e) {\n\t\t\tthrow new ArchiveException( \"Unable to convert jar File to URL [\" + jarFileReference + \"]\", e );\n\t\t}\n\n\t\tthrow new ArchiveException( \"Unable to resolve <jar-file/> reference - \" + jarFileReference );\n\t}\n}\n","sourceCodeStart":211,"sourceCodeEnd":235,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ExplodedArchiveDescriptor.java#L211-L235","documentation":"Thrown by ExplodedArchiveDescriptor when a resolved jar File for a <jar-file/> reference cannot be converted to a URL (MalformedURLException) while processing an exploded archive.","triggerScenarios":"The <jar-file> reference resolves to a File on disk, but File.toURI().toURL() fails because the path cannot form a valid URL.","commonSituations":"Exploded deployments located on paths with spaces, non-ASCII characters, or unusual mount points.","solutions":["Relocate the application to a path containing only URL-safe characters.","Verify the referenced jar file actually exists at the resolved location.","Use a packaged JAR deployment instead of an exploded directory."],"exampleFix":"Check that the jar file path referenced by the <jar-file/> element exists on disk and is readable. Convert the File to a URL with toURI().toURL() and catch MalformedURLException only around genuinely invalid paths.","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"}