In the documentation on http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/sample/ a sample war file is linked with the link: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/sample/sample.war The file is not compressed correctly, it is impossible to uncompress it. For example: C:\Programme\Tomcat\webapps\sample>jar -xvf sample.war erstellt: META-INF/ extrahiert: META-INF/MANIFEST.MF java.util.zip.ZipException: invalid entry size (expected 975 but got 470 bytes) at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:368) at java.util.zip.ZipInputStream.read(ZipInputStream.java:141) at sun.tools.jar.Main.extractFile(Main.java:714) at sun.tools.jar.Main.extract(Main.java:677) at sun.tools.jar.Main.run(Main.java:189) at sun.tools.jar.Main.main(Main.java:903)
I have tested the file and I have no problems expanding it. A check of the file date shows it has not changed since this report so it looks like your download was corrupted.
What is your MD5/SHA1 sum of the file? sstein@laptop-seb:~/test$ wget http://jakarta.apache.org/tomcat/tomcat-5.5-doc/appdev/sample/sample.war sstein@laptop-seb:~/test$ md5sum sample.war 7f34e9dfcd6719f4a4de65a891384179 sample.war sstein@laptop-seb:~/test$ sha1sum sample.war 4091cc5852a79912f0e3dfea6747ab5cae5163b6 sample.war sstein@laptop-seb:~/test$ unzip sample.war Archive: sample.war creating: META-INF/ extracting: META-INF/MANIFEST.MF inflating: hello.jsp bad CRC 03f8858c (should be 23d12d91) creating: images/ creating: images/CVS/ inflating: images/CVS/Root bad CRC 8d694f56 (should be 3f694f56) inflating: images/CVS/Repository inflating: images/CVS/Entries bad CRC f30ae6d7 (should be ca2855dc) inflating: images/tomcat.gif bad CRC e6ee8c60 (should be 9706fba8) inflating: index.html error: invalid compressed data to inflate creating: WEB-INF/ creating: WEB-INF/src/ creating: WEB-INF/src/mypackage/ inflating: WEB-INF/src/mypackage/Hello.java bad CRC 81241ac3 (should be 739f5d43) inflating: WEB-INF/web.xml error: invalid compressed data to inflate creating: WEB-INF/classes/ creating: WEB-INF/classes/mypackage/ inflating: WEB-INF/classes/mypackage/Hello.class error: invalid compressed data to inflate
My bad, I didn't check far enough. The file is broken. I'll upload a fixed one but it will take a couple of hours to replicate to the main Apache web server.
For the record, the MD5 of the fixed file is 8c6d76407406763b2b69b5fda3cf8e6d
Just tried several times to download it and the corrupted file seems to be back. $ md5sum sample.war 7f34e9dfcd6719f4a4de65a891384179 sample.war (several download tries, I'm wondering if this is now a different file than your md5sum, hence compression errors) Archive: sample.war creating: META-INF/ extracting: META-INF/MANIFEST.MF inflating: hello.jsp bad CRC 03f8858c (should be 23d12d91) creating: images/ creating: images/CVS/ inflating: images/CVS/Root bad CRC 8d694f56 (should be 3f694f56) inflating: images/CVS/Repository inflating: images/CVS/Entries bad CRC f30ae6d7 (should be ca2855dc) inflating: images/tomcat.gif bad CRC e6ee8c60 (should be 9706fba8) inflating: index.html error: invalid compressed data to inflate creating: WEB-INF/ creating: WEB-INF/src/ creating: WEB-INF/src/mypackage/ inflating: WEB-INF/src/mypackage/Hello.java bad CRC 81241ac3 (should be 739f5d43) inflating: WEB-INF/web.xml error: invalid compressed data to inflate creating: WEB-INF/classes/ creating: WEB-INF/classes/mypackage/ inflating: WEB-INF/classes/mypackage/Hello.class error: invalid compressed data to inflate Getting the same older incorrect CRC errors. Possibly a server replication error somewhere?
OK, fixed again. It will take a couple of hours to sync to the main web site.
Confirmed, looks good now, thanks.
I'm reopening this until we find a proper fix in the release process. The file is about to get corrupted again as I'm releasing 5.5.14. I've investigated some, but can't find the guilty task/target in the build process that is corrupting this file. Others have suggested that Ant's copy with filtering is to blame, but I cannot find a copy with filtering task that applies to sample.war. Same thing for the fixcrlf tasks suggested to me by someone privately. Help investigating and resolving this matter would be appreciated.
I've also tested that the same happens on minotaur.apache.org, not just my PC, so it's not a Windows-specific thing. And I've also tested that the package-tgz-docs task by itself is not the culprit: if I place the right file in {tomcat.dist}/webapps/tomcat-docs/appdev/sample/sample.war, the resulting fulldocs.tar.gz is correct. So the checksum change/corruption must be happening during an earlier copy operation.
fixcrlf was being applied. Fixed in 5.5 head.