{"record":{"id":"ec9cc0c337478158","repo":"hibernate/hibernate-orm","slug":"unable-to-create-archive-entry-uri","errorCode":null,"errorMessage":"Unable to create archive entry URI","messagePattern":"Unable to create archive entry URI","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ExplodedArchiveDescriptor.java","lineNumber":174,"sourceCode":"\t\t\t\t\t\t\t\t\tzipEntry.getName()\n\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// todo (jpa4) : for now, pass null\n\t\t\t\tentryConsumer.accept( new ArchiveEntryImpl(\n\t\t\t\t\t\tname,\n\t\t\t\t\t\trelativeName,\n\t\t\t\t\t\tnew URL( \"jar:\" + entryUriBase + \"!/\" + relativeName ).toURI(),\n\t\t\t\t\t\tinputStreamAccess\n\t\t\t\t) );\n\t\t\t}\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new ArchiveException( \"Error accessing jar file [\" + rootFile.getAbsolutePath() + \"]\", e );\n\t\t}\n\t\tcatch (URISyntaxException e) {\n\t\t\tthrow new ArchiveException( \"Unable to create archive entry URI\", e );\n\t\t}\n\t}\n\n\n\t@Override\n\tpublic @Nullable ArchiveEntry findEntry(String relativePath) {\n\t\tfinal File file = resolveRelativePath( relativePath );\n\t\tif ( file == null ) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal String name = file.getAbsolutePath();\n\t\tfinal InputStreamAccess inputStreamAccess = new FileInputStreamAccess( name, file );\n\t\treturn new ArchiveEntryImpl( name, relativePath, file.toURI(), inputStreamAccess );\n\t}\n\n\tprivate File resolveRelativePath(String relativePath) {\n\t\tfinal File rootDirectory = resolveRootDirectory();\n\t\tif ( rootDirectory == null ) {","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ExplodedArchiveDescriptor.java#L156-L192","documentation":"Thrown by ExplodedArchiveDescriptor when building a URI for an entry inside an exploded (directory-based) archive fails with a URISyntaxException. This happens during Hibernate bootstrap archive scanning when a jar-file reference points to an unpacked directory.","triggerScenarios":"A persistence.xml or Hibernate configuration references an exploded archive (directory treated as a jar), and the file path of an entry contains characters that cannot be encoded into a valid URI.","commonSituations":"Deploying an application from an exploded WAR/EAR directory whose path contains spaces or non-ASCII characters; running tests against a classes directory on a path with unusual characters.","solutions":["Move the exploded archive to a path that contains only URI-safe characters (no spaces or special characters).","Package the classes into a real JAR file and reference the JAR instead of the directory.","Ensure the file system encoding matches the JVM default encoding so paths can be encoded as URIs."],"exampleFix":"Ensure the archive entry URL is well-formed and points to an existing entry inside the exploded archive directory. Verify the root file path is readable and that the entry path contains no illegal URI characters before calling descriptor.visitArchive.","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"}