{"record":{"id":"d73159caa5efa733","repo":"hibernate/hibernate-orm","slug":"error-accessing-jarfile-entry","errorCode":null,"errorMessage":"Error accessing JarFile entry [{}]","messagePattern":"Error accessing JarFile entry \\[(.+?)\\]","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/archive/internal/JarFileBasedArchiveDescriptor.java","lineNumber":96,"sourceCode":"\t\t\t\t\t\twhile ( subZipEntry != null ) {\n\t\t\t\t\t\t\tif ( ! subZipEntry.isDirectory() ) {\n\n\t\t\t\t\t\t\t\tfinal String name = extractName( subZipEntry );\n\t\t\t\t\t\t\t\tfinal String relativeName = extractRelativeName( subZipEntry );\n\n\t\t\t\t\t\t\t\tentryConsumer.accept( new ArchiveEntryImpl(\n\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\trelativeName,\n\t\t\t\t\t\t\t\t\t\tURI.create( \"jar:\" + archiveUrl.toExternalForm() + \"!/\" + relativeName ),\n\t\t\t\t\t\t\t\t\t\tbuildByteBasedInputStreamAccess( name, jarInputStream )\n\t\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsubZipEntry = jarInputStream.getNextEntry();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception e) {\n\t\t\t\t\t\tthrow new ArchiveException( \"Error accessing JarFile entry [\" + zipEntry.getName() + \"]\", e );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfinal String name = extractName( zipEntry );\n\t\t\t\t\tfinal String relativeName = extractRelativeName( zipEntry );\n\t\t\t\t\tfinal InputStreamAccess inputStreamAccess;\n\t\t\t\t\ttry (InputStream is = jarFile.getInputStream( zipEntry )) {\n\t\t\t\t\t\tinputStreamAccess = buildByteBasedInputStreamAccess( name, is );\n\t\t\t\t\t}\n\t\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t\tthrow new ArchiveException(\n\t\t\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\t\t\"Unable to access stream from jar file [%s] for entry [%s]\",\n\t\t\t\t\t\t\t\t\t\tjarFile.getName(),\n\t\t\t\t\t\t\t\t\t\tzipEntry.getName()\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t}","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/archive/internal/JarFileBasedArchiveDescriptor.java#L78-L114","documentation":"Catch-all wrapper around iteration of entries inside a nested jar found within the archive: any unexpected Exception while reading sub-entries or building the stream access for a nested jar is rethrown as this ArchiveException with the offending outer entry name. Usually indicates a corrupt or unreadable nested jar.","triggerScenarios":"The jar referenced by a <jar-file> entry or the persistence unit root is corrupt, truncated, or becomes unreadable while Hibernate iterates its entries.","commonSituations":"Corrupted jar from a partial download or failed build; jar modified/replaced while the application is running; disk I/O errors.","solutions":["Rebuild or re-download the jar file to fix corruption.","Verify jar integrity with 'jar tf file.jar' or 'unzip -t file.jar'.","Avoid replacing jar files in a running deployment; redeploy instead."],"exampleFix":"The jar entry could not be read. Verify the jar file is not corrupted (run 'jar tf' on it), that it is fully written before Hibernate scans it, and that the process has read access to it.","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}