tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Warren Jr <cla...@xenei.com>
Subject invalid LOC header (bad signature) when running in servlet only
Date Fri, 26 Jan 2007 22:05:38 GMT
>  
>> >> Subject: invalid LOC header (bad signature) when running in >> 
>> servlet only
>> >>
>> >>  message = invalid LOC header (bad signature)
>> >>         
> >
> > This is an indication of a corrupted .zip file.  ZIP files can be read
> > either sequentially or via the table of contents at the end of the 
> file;
> > the LOC header is only used when access is via the TOC.  The
> > java.util.zip classes use the TOC, while many other mechanisms use
> > sequential access and do not encounter the invalid LOC header.
> >
> > One way this corruption can be introduced is by doing an FTP of the 
> file
> > in ASCII mode using a Windows FTP client; this has the annoying 
> habit of
> > converting LF characters into CR/LF sequences (or vice versa), which is
> > not something you want to do with a ZIP file.  You should be able to 
> get
> > rid of the error by rebuilding the file.
> >
> >     
Chuck,

Thank you for the description of how the TOC is accessed at least now I 
may have a way to work around the issue.  But it does not answer the 
basic question: Why does this only occur in the servlet environment and 
not in the stand alone environment even when reading the file from the 
same location?  It is as though the servlet environment is modifying or 
truncating the end of the file only during the TOC read since the MD5 
checks are the same in both environments.

I suppose it might have something to do with the JarURLConnection 
implementation.

Any ideas how to implement a valid JarFile from an input stream?  
Perhaps I can just work around the possible JarURLConnection defect.

Claude





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message