Re: ant/jdk17, and badly generated jars

Jaikiran Pai <[email protected]> Sat, 28 Oct 2023 06:03:33 +0530
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
Hello Dave,

In addition to what Stefan noted, could you also tell us which specific 
version of Java 17 this is? The output from "java -version" command 
would be useful.

-Jaikiran

On 27/10/23 11:31 pm, Stefan Bodewig wrote:
> Hi Dave
>
> Dave Brosius <[email protected]> writes:
>
>> HI folks, we have an odd situation where we have an ant build that
>> generates a jar file that includes a resource bundle property file
>> using <jar>, later in the same build  a custom ant task is executed,
>> which loads that class from  the classpath, and tries to read that
>> bundle file, and fails  with
>>
>> [genSchema] Caused by: java.util.zip.ZipException: ZipFile invalid LOC
>> header (bad signature)
> The OpenJDK folks have been adding additional checks inside the zip
> package which may reject archives it has been able to read before. This
> has found at least one bug in Ant's zip code[1] which looks unrelated to
> your exception (and has been fixed in 1.10.14).
>
> It may be the case this is another bug inside of Ant's zip package - or
> the added checks inside of th JDK are wrong. Any chance you could try
> with jdk21 (I've seen they've relaxed/adapted some checks after jdk17)?
>
> Also you may want to check the jar with a different zip tool like unzip
> to see whether it emits any warnings. If all else fails, it would be
> great if you could provide us with a jar that's been rejected so we can
> have a look ourselves.
>
> Cheers
>
>          Stefan
>
> [1] https://bz.apache.org/bugzilla/show_bug.cgi?id=66873
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>