hibernate/hibernate-orm · error · ArchiveException

Unable to access stream from jar file [%s] for entry [%s]

Error message

Unable to access stream from jar file [%s] for entry [%s]

What it means

Thrown by JarFileBasedArchiveDescriptor when an InputStream for a specific entry inside the jar cannot be obtained (IOException), even though the jar itself was opened.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/boot/archive/internal/JarFileBasedArchiveDescriptor.java:107

								) );
							}

							subZipEntry = jarInputStream.getNextEntry();
						}
					}
					catch (Exception e) {
						throw new ArchiveException( "Error accessing JarFile entry [" + zipEntry.getName() + "]", e );
					}
				}
				else {
					final String name = extractName( zipEntry );
					final String relativeName = extractRelativeName( zipEntry );
					final InputStreamAccess inputStreamAccess;
					try (InputStream is = jarFile.getInputStream( zipEntry )) {
						inputStreamAccess = buildByteBasedInputStreamAccess( name, is );
					}
					catch (IOException e) {
						throw new ArchiveException(
								String.format(
										"Unable to access stream from jar file [%s] for entry [%s]",
										jarFile.getName(),
										zipEntry.getName()
								)
						);
					}

					entryConsumer.accept( new ArchiveEntryImpl(
							name,
							relativeName,
							URI.create( "jar:" + archiveUrl.toExternalForm() + "!/" + relativeName ),
							inputStreamAccess
					) );
				}
			}
		}
		finally {

View on GitHub (pinned to fad1729dce)

Solutions

  1. Rebuild the jar cleanly (delete build output and rebuild).
  2. Test the jar with 'unzip -t' to find the corrupt entry.
  3. Stop processes that might rewrite the jar during scanning.

Example fix

Ensure the jar file and the named entry both exist and are readable. Close any other handles to the jar, and avoid scanning jars that are being written concurrently.

When it happens

Trigger: A single entry in the jar (class file or resource) cannot be read, typically due to a corrupt zip entry or the jar being closed/modified mid-scan.

Common situations: Corrupt jar entries from interrupted builds; jar file overwritten while the application holds it open.


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