Re: Ant Jar Issue

Stefan Bodewig <[email protected]>
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
On 2015-10-13, Jackie Xiao wrote:

> ​Dear list

>>> The issue:
> When jar-ing a module which contains binary certificate file (auth.p12) on CentOS, with Ant 1.9.2, it seems the p12 file was corrupted after jar compression. (When reading the cerf file with InputStream, below exception was thrown)

> Exception message:


>>> The subtle thing:
> BUT, if we open the result jar with 7zip on Windows, drag out the p12 file, then drag into the jar again, the certificate file can be read without problem by InputStream.

>>> The guess:
> So, 7zip can compress the file correctly, which made me guess it's the jar task which caused the problem.

At the same time 7zip has been able to extract the certificate so the
archive itself has been readable for 7zip.  This indicates the archive
was correct but you've run into an issue with the code that is
extracting the jar.

> So I use "jar xvf jarfile" to unjar, then "tar xvf myfile.jar *" to "tar a jar file", and it worked....

I'm not sure I understand which jar you've expanded.  The one created by
Ant or the one created by 7zip.

If it has been the original archive, this also means the jar tool has
been able to read the archive.  This would hint the problem is within
the code you use to read the archive.

Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.