Grokbase Groups Ant user October 2015
FAQ
​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.

So I use "jar xvf jarfile" to unjar, then "tar xvf myfile.jar *" to "tar a jar file", and it worked....
The question:
Have you guys encounter the same issue, or any suggestions.

Thanks in advance.




This e-mail and any attachments thereto are intended for the sole use of the recipient(s) named above and may contain confidential and/or privileged material. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication, or dissemination in any form) by persons other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

Search Discussions

  • Jackie Xiao at Oct 13, 2015 at 11:42 pm
    Sorry, adding the missing exception message:
    Constructor threw exception; nested exception is java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big.

    Which should mean the certificate file was corrupted.
    ________________________________________
    From: Jackie Xiao
    Sent: Wednesday, October 14, 2015 12:32 AM
    To: user@ant.apache.org
    Cc: Jackie Xiao
    Subject: Ant Jar Issue

    ​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.

    So I use "jar xvf jarfile" to unjar, then "tar xvf myfile.jar *" to "tar a jar file", and it worked....
    The question:
    Have you guys encounter the same issue, or any suggestions.

    Thanks in advance.


    This e-mail and any attachments thereto are intended for the sole use of the recipient(s) named above and may contain confidential and/or privileged material. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication, or dissemination in any form) by persons other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Martin Gainty at Oct 14, 2015 at 12:48 am
    the distinction between compressing using the jar compression algorithm with ant jar task which employes LZ+HUF
    http://compressionratings.com/i_jar.html

    and packaging a signed jar which expects these attributes to be honored
    compression algorithm
    alias
    storepass
    signature algorithm

    to create a signed jar with those attributes use signjar

    https://ant.apache.org/manual/Tasks/signjar.html
    HTH
    Martin Gainty
    ______________________________________________


    From: jackie.xiao@ebaotech.com
    To: user@ant.apache.org
    CC: jackie.xiao@ebaotech.com
    Subject: Ant Jar Issue
    Date: Tue, 13 Oct 2015 16:32:51 +0000


    ​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.

    So I use "jar xvf jarfile" to unjar, then "tar xvf myfile.jar *" to "tar a jar file", and it worked....
    The question:
    Have you guys encounter the same issue, or any suggestions.

    Thanks in advance.




    This e-mail and any attachments thereto are intended for the sole use of the recipient(s) named above and may contain confidential and/or privileged material. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication, or dissemination in any form) by persons other than the intended recipient(s) is prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer.

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Stefan Bodewig at Oct 14, 2015 at 4:07 am

    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

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriesant
postedOct 13, '15 at 11:42p
activeOct 14, '15 at 4:07a
posts4
users3
websiteant.apache.org

People

Translate

site design / logo © 2018 Grokbase