Free Support Forum - groupdocs.com

Build servlet example and invalid CEN header (bad signature)


#1

Hi,

Tried to build example application for servlet and stuck with error like invalid CEN header (bad signature):

D:\dev\web-viewer>ant war
Buildfile: D:\dev\web-viewer\build.xml

clean:
[echo] Cleaning the build
[delete] Deleting directory D:\dev\web-viewer\build
[echo] Cleaning the dist
[echo] Cleaning the out

init:
[echo] Creating the build directory
[mkdir] Created dir: D:\dev\web-viewer\build\WEB-INF\classes
[mkdir] Created dir: D:\dev\web-viewer\build\WEB-INF\lib

compile:
[echo] Compile the source files
[javac] D:\dev\web-viewer\build.xml:26: warning: ‘includeantruntime’ was not set, defaul
ting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 20 source files to D:\dev\web-viewer1\build\WEB-INF\classes
[javac] error: error reading C:\Users\Andrey.m2\repository\com\groupdocs\groupdocs-viewer\2.6.0
\groupdocs-viewer-2.6.0.jar; invalid CEN header (bad signature)
[javac] 1 error

BUILD FAILED
D:\dev\web-viewer\build.xml:26: Compile failed; see the compiler error output for details.


#2
Hello Andrey,

From the log you provided, it seems that the groupdocs-viewer-2.6.0.jar file in your maven repository is corrupted. Try to redownload it from the GroupDocs archive and install it again using command provided here: http://groupdocs.com/docs/display/viewerjava/GroupDocs.Viewer+for+Java+-+Installation

I tried to build servlet example from the provided samples archive and everything builds fine, the only thing I had to change is configuration and add this line
to the directory.


#3

Hi Ihor,

Redownloaded several times and went through install instruction provided from link and the same issue.
Also tried:> jar tvf GroupDocs.Viewer.jar
java.util.zip.ZipException: invalid CEN header (bad signature)

thought 2.5.0 version works fine.


#4

Steps to reproduce:
1)download GroupDocs.Viewer_2.6.0_java.zip from link: http://groupdocs.com/Community/files/9/java-libraries/groupdocs_viewer_for_java/entry3896.aspx
2) unzip file
3) go to lib dir
4) run: jar tvf GroupDocs.Viewer.jar
Getting error:
java.util.zip.ZipException: invalid CEN header (bad signature)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:127)
at java.util.zip.ZipFile.(ZipFile.java:88)
at sun.tools.jar.Main.list(Main.java:977)
at sun.tools.jar.Main.run(Main.java:222)
at sun.tools.jar.Main.main(Main.java:1147)


#5
Thank you for the provided info Andrey,

Please, check if the size of the GroupDocs.Viewer_2.6.0_java.zip archive is near 99,7Mb. Also here I provide checksums for archive and the jar itself.
GroupDocs.Viewer_2.6.0_java.zip
  • MD5: c9a2dc8e5786c4f5cd83e5fd18d3b149
  • SHA1: 24d47cae4f689f883c2a446ec961b7b585aa6a5e
GroupDocs.Viewer.jar
  • MD5: 6e02645cf36f92e4655f766b72fbba96
  • SHA1: 0c6e689d09494ac5a7de3cc2debdd066e380d1a2
Maybe there is problem with downloading the archive. Can you give more details about your environment?


#6

I tried to build with java 6 and got the error. I switched to java 7(jdk1.7.0_67) and now it works fine. Looks like zip-64 support was apparently only added in 1.7.0_b55
https://blogs.oracle.com/xuemingshen/entry/zip64_support_for_4g_zipfile



#7

Glad to see that the problem is fixed now.