{"record":{"id":"035bfa3d8515a612","repo":"hibernate/hibernate-orm","slug":"unable-to-convert-relative-jar-file-reference-to-u-035bfa","errorCode":null,"errorMessage":"Unable to convert relative jar-file reference to URL [{}]","messagePattern":"Unable to convert relative jar-file reference to URL \\[(.+?)\\]","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/archive/internal/JarInputStreamBasedArchiveDescriptor.java","lineNumber":257,"sourceCode":"\t\t\t\tjarInputStream.close();\n\t\t\t}\n\t\t\tcatch (IOException e) {\n\t\t\t\t// Ignore\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\t@Override @Nonnull\n\tpublic ArchiveDescriptor resolveJarFileReference(@Nonnull String jarFileReference) {\n\t\t// try it as a relative reference\n\t\tfinal ArchiveEntry entry = findEntry( jarFileReference );\n\t\tif ( entry != null ) {\n\t\t\ttry {\n\t\t\t\treturn new NestedJarDescriptor( entry.getUri().toURL() );\n\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\tthrow new ArchiveException( \"Unable to resolve <jar-file/> reference - \" + jarFileReference );\n\t}\n}\n","sourceCodeStart":239,"sourceCodeEnd":269,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/JarInputStreamBasedArchiveDescriptor.java#L239-L269","documentation":"Error \"Unable to convert relative jar-file reference to URL [{}]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A relative <jar-file/> reference in persistence.xml cannot be converted to a URL.","commonSituations":"JSE-style persistence.xml using relative jar paths, or a pu root URL with a nonstandard protocol (e.g. inside a fat jar).","solutions":["Fix the <jar-file/> reference in persistence.xml so it is a valid relative path or absolute URL; Hibernate resolves it relative to the persistence unit root.","Make sure the referenced jar actually exists relative to the root URL of the persistence unit.","If the jar lives outside the persistence unit root, use an absolute file: or jar: URL instead of a relative reference."],"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"}