We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

GroupDocs jar cannot be read from springboot fat executable JAR

Hi,
I am using GroupDocs viewer in my springboot application.
After packaging springboot application as a JAR I am trying to launch the application using java -jar command.
It fails with the error -
Exception in thread “main” java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/groupdocs-viewer-18.6.2.jar

Same error for, GroupDocs comparison jar too.
Below is the full error -

Exception in thread “main” java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/groupdocs-comparison-18.6.2.jar
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:86)
at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:70)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.io.IOException: Unable to open nested jar file ‘BOOT-INF/lib/groupdocs-comparison-18.6.2.jar’
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:256)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:241)
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103)
… 4 more
Caused by: java.lang.IllegalStateException: Zip64 archives are not supported
at org.springframework.boot.loader.jar.CentralDirectoryEndRecord.getNumberOfRecords(CentralDirectoryEndRecord.java:124)
at org.springframework.boot.loader.jar.JarFileEntries.visitStart(JarFileEntries.java:120)
at org.springframework.boot.loader.jar.CentralDirectoryParser.visitStart(CentralDirectoryParser.java:89)
at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:57)
at org.springframework.boot.loader.jar.JarFile.(JarFile.java:123)
at org.springframework.boot.loader.jar.JarFile.(JarFile.java:111)
at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:289)
at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:264)
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:252)
… 6 more

@nirajsingh24,

Thanks for posting your inquiry.

We have tried running GroupDocs.Viewer for Java - Spring application from a packaged JAR but unable to reproduce your reported issue at our end. In case you have updated the pom.xml at your end, please share that with us. We shall be looking forward to your response.

pom.zip (1.3 KB)
Attaching POM here.

I build my application JAR using -
mvn clean install

Then I try to run the application using -
java -jar jarname

It gives error mentioned in my first comment.

@nirajsingh24,

We are able to reproduce your reported issue at our end. We have logged it in our Issue Tracking System as VIEWERJAVA-1886 for further investigation. We shall notify you as soon as we get any updates for you.

@nirajsingh24,

We have got the updates regarding your reported exception. GroupDocs.Viewer for Java’s JAR is a Zip64 archive which is not supported by Spring Boot’s Loader and therefore, the exception Zip64 archives are not supported is thrown at your end. Hence, this issue is generic for all Zip64 archives and is not related to GroupDocs.Viewer for Java API.

Hi,
Is there a workaround? I am stuck on it.
Are there other people using GroupDocs JARs with Spring Boot? I tried to find out a solution but haven’t gotten yet. Does this mean GroupDocs JARs cannot be used with Spring Boot due to this limitation?

Spring Boot forum advises to break the big JARs into nested JARs to avoid this problem. Do you guys want to consider this solution as most of the GroupDOcs JAR seem to be ZIP64?
Thanks

@nirajsingh24,

Yes, GroupDocs JARs can be used with the Spring Boot application. For reference, you can download and try our Spring Boot application that uses GroupDocs.Viewer for Java at the back-end. The application can be downloaded from here.

Furthermore, we also noticed that using spring-boot-maven-plugin (that you have used in your pom.xml) in our Spring Boot application raises Zip64 archives are not supported exception. However, using maven-compiler-plugin instead of spring-boot-maven-plugin in the pom.xml resolves this issue. Hope this workaround helps you.

Do you have any solution for the same problem with gradle?

@valentinz,

I am afraid that we don’t have the solution for this problem with Gradle since the problem is generic for all Zip64 archives and is not specific to GroupDocs.Viewer for Java.

Would it be possible build more than one .jar? I suppose you have enough customers with spring / gradle bundle :slight_smile:

@valentinz,

GroupDocs.Viewer is released as a single JAR file and we do not offer multiple JARs.

Dear Groupdocs Team,

Not sure if the issue of “zip64 format not supported” in Springboot fat executable jar is resolved or not.
We found Groupdocs.Coversion product to be suitable for our business requirement and we have tested its capabilities with evaluation copy of version 17.12.
We are in the process of procurement, however we found the same issue while moving further with our deployments. Currently we are using Springboot version 2.1.8.RELEASE.
Can you please confirm if this issue is fixed in the latest available version 21.7? If yes, which Springboot version is compatible to work with the latest Groupdocs.Conversion module.?

Thanks

@ChourasiyaRajesh

Please this topic - Zip64 format not supported in Springboot fat executable jar