Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to open archive entry when dependent Jar is greater than 2GB #28595

Closed
Oluwatobiadeoye opened this issue Nov 10, 2021 · 6 comments
Closed
Labels
status: duplicate A duplicate of another issue

Comments

@Oluwatobiadeoye
Copy link

Oluwatobiadeoye commented Nov 10, 2021

Hi Team

I have this project where I have a dependent jar whose size is greater than 2GB. I use the spring-boot-maven plugin to package the application and when starting the application, it immediately fails with the below error. I was able to run the application successfully when this jar was still less than 2Gb but it started failing recently when the size of this jar increased.

Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/pure-model-di-compiled-1.1.20211101.0619.jar
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:113)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
        at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/pure-model-di-compiled-1.1.20211101.0619.jar'
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:261)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
        ... 4 more
Caused by: java.io.IOException: Negative seek offset
        at java.io.RandomAccessFile.seek(Unknown Source)
        at org.springframework.boot.loader.data.RandomAccessDataFile$FileAccess.read(RandomAccessDataFile.java:221)
        at org.springframework.boot.loader.data.RandomAccessDataFile$FileAccess.access$400(RandomAccessDataFile.java:205)
        at org.springframework.boot.loader.data.RandomAccessDataFile.read(RandomAccessDataFile.java:117)
        at org.springframework.boot.loader.data.RandomAccessDataFile.read(RandomAccessDataFile.java:102)
        at org.springframework.boot.loader.jar.CentralDirectoryEndRecord$Zip64Locator.<init>(CentralDirectoryEndRecord.java:227)
        at org.springframework.boot.loader.jar.CentralDirectoryEndRecord$Zip64Locator.<init>(CentralDirectoryEndRecord.java:216)
        at org.springframework.boot.loader.jar.CentralDirectoryEndRecord$Zip64End.<init>(CentralDirectoryEndRecord.java:171)
        at org.springframework.boot.loader.jar.CentralDirectoryEndRecord$Zip64End.<init>(CentralDirectoryEndRecord.java:154)
        at org.springframework.boot.loader.jar.CentralDirectoryEndRecord.<init>(CentralDirectoryEndRecord.java:78)
        at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:51)
        at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:127)
        at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:114)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:292)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:269)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:258)
        ... 6 more

Spring Boot Version: 2.2.5-RELEASE

Unfortunately , I'm unable to provide my pom file as this is for an internal project.

I will appreciate any help here.

Thanks.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 10, 2021
@wilkinsona
Copy link
Member

This may be a duplicate of #27822 which was fixed in Spring Boot 2.4.x.

Spring Boot 2.2 is no longer supported. Please upgrade to 2.4.x or later and let us know if it fixes the problem. If it does not, please create a small sample project that reproduces the failure and share it with us by zipping it up and attaching it to this issue or pushing it to a separate GitHub repository.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Nov 10, 2021
@Oluwatobiadeoye
Copy link
Author

Thanks for you quick response.

You were right. Upgrading the jar to 2.4.11 resolved the issue. At the same time I noticed a more recent version 2.5.4 has the same issue as before.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 11, 2021
@wilkinsona
Copy link
Member

Thanks. That's interesting. It should work with both 2.4.x and 2.5.x as the same fixes were made in each branch. If you would like us to investigate the problem with 2.5.x, please create and share with us a small sample project that reproduces the failure.

@wilkinsona wilkinsona added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Nov 11, 2021
@Oluwatobiadeoye
Copy link
Author

Could be because version 2.5.4 was released before this fix was committed. I will see if i can reproduce with a small project.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 11, 2021
@wilkinsona
Copy link
Member

Yes, you may need 2.5.5 or later as it contains #27900.

@wilkinsona wilkinsona added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Nov 11, 2021
@Oluwatobiadeoye
Copy link
Author

Yeah that makes more sense now. Closing as the issue is resolved

@wilkinsona wilkinsona added status: duplicate A duplicate of another issue and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Nov 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants