Free Support Forum -

GroupDocs jar cannot be read from springboot fat executable JAR


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(
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(
at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(
at org.springframework.boot.loader.Launcher.launch(
at org.springframework.boot.loader.JarLauncher.main(
Caused by: Unable to open nested jar file ‘BOOT-INF/lib/groupdocs-comparison-18.6.2.jar’
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(
at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(
… 4 more
Caused by: java.lang.IllegalStateException: Zip64 archives are not supported
at org.springframework.boot.loader.jar.CentralDirectoryEndRecord.getNumberOfRecords(
at org.springframework.boot.loader.jar.JarFileEntries.visitStart(
at org.springframework.boot.loader.jar.CentralDirectoryParser.visitStart(
at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(
at org.springframework.boot.loader.jar.JarFile.(
at org.springframework.boot.loader.jar.JarFile.(
at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(
at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(
at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(
… 6 more



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.

#3 (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.



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.



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.


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?



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.