hibernate/hibernate-orm · error · ArchiveException

Error accessing nested jar

Error message

Error accessing nested jar

What it means

Generic safety net around processing of a nested jar within a JarInputStream-based archive: any non-ArchiveException failure while reading the nested stream is wrapped here. It flags an unexpected low-level failure (stream corruption, unsupported zip feature) during nested-jar scanning; ArchiveExceptions from inner processing are rethrown unchanged.

Solutions

  1. Rebuild the outer archive so the nested jar is written completely.
  2. Test nested jars with 'unzip -t' after extracting them.
  3. Avoid shading/repackaging steps that corrupt nested jars.

Example fix

A nested jar (jar inside jar) could not be read. Nested archives are not supported for scanning; unpack the nested jar or move the classes to the top-level archive.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: A jar embedded inside another jar is corrupt or truncated, so iterating its entries fails during scanning.

Common situations: Corrupt nested jar from a failed or partial assembly; repackaging tools that damaged inner jars.


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

Appendix: source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/archive/internal/JarInputStreamBasedArchiveDescriptor.java:115

						catch (URISyntaxException e) {
							throw new ArchiveException(
									String.format( Locale.ROOT,
											"Unable to create archive entry URI: %s - %s",
											archiveUrl,
											jarEntry.getName()
									),
									e
							);
						}
						finally {
							subJarInputStream.close();
						}
					}
					catch (ArchiveException e) {
						throw e;
					}
					catch (Exception e) {
						throw new ArchiveException( "Error accessing nested jar", e );
					}
				}
				else {
					try {
						final String entryName = extractName( jarEntry );
						final InputStreamAccess inputStreamAccess = buildByteBasedInputStreamAccess( entryName, jarInputStream );

						final String relativeName = extractRelativeName( jarEntry );
						entryConsumer.accept( new ArchiveEntryImpl(
								relativeName,
								relativeName,
								new URI( archiveUrl + "!/" + relativeName ),
								inputStreamAccess
						) );
					}
					catch (URISyntaxException e) {
						throw new ArchiveException(
								String.format( Locale.ROOT,

View on GitHub (pinned to fad1729dce)