hibernate/hibernate-orm · error · ArchiveException

Unable to create archive entry URI

Error message

Unable to create archive entry URI

What it means

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.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/archive/internal/ExplodedArchiveDescriptor.java:174

									zipEntry.getName()
							)
					);
				}

				// todo (jpa4) : for now, pass null
				entryConsumer.accept( new ArchiveEntryImpl(
						name,
						relativeName,
						new URL( "jar:" + entryUriBase + "!/" + relativeName ).toURI(),
						inputStreamAccess
				) );
			}
		}
		catch (IOException e) {
			throw new ArchiveException( "Error accessing jar file [" + rootFile.getAbsolutePath() + "]", e );
		}
		catch (URISyntaxException e) {
			throw new ArchiveException( "Unable to create archive entry URI", e );
		}
	}


	@Override
	public @Nullable ArchiveEntry findEntry(String relativePath) {
		final File file = resolveRelativePath( relativePath );
		if ( file == null ) {
			return null;
		}
		final String name = file.getAbsolutePath();
		final InputStreamAccess inputStreamAccess = new FileInputStreamAccess( name, file );
		return new ArchiveEntryImpl( name, relativePath, file.toURI(), inputStreamAccess );
	}

	private File resolveRelativePath(String relativePath) {
		final File rootDirectory = resolveRootDirectory();
		if ( rootDirectory == null ) {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Move the exploded archive to a path that contains only URI-safe characters (no spaces or special characters).
  2. Package the classes into a real JAR file and reference the JAR instead of the directory.
  3. Ensure the file system encoding matches the JVM default encoding so paths can be encoded as URIs.

Example fix

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.

When it happens

Trigger: 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.

Common situations: 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.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/ec9cc0c337478158. Report an issue: GitHub.