Re: [External] : Re: ant/jdk17, and badly generated jars

Dave Brosius <[email protected]> Fri, 27 Oct 2023 23:01:44 -0400
Newsgroups gmane.comp.jakarta.ant.user
Message-ID <[email protected]>
java version "17.0.2" 2022-01-18 LTS
Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, 
sharing)


Apache Ant(TM) version 1.10.14 compiled on August 16 2023


Distributor ID:    Linuxmint
Description:    Linux Mint 20.3
Release:    20.3
Codename:    una


I tried debugging the ant task standalone running  against the 
pregenerated jar, and in this case the code ran fine, It seems like i 
only have problems when the jar is generated in the same process as when 
i tried to load.


--dave



On 10/27/23 20:33, Jaikiran Pai wrote:
> 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://urldefense.com/v3/__https://bz.apache.org/bugzilla/show_bug.cgi?id=66873__;!!ACWV5N9M2RV99hQ!POftHvnDa-UXJC8nyoO5MTV5pZLBUO0ElzffxPhYHLyMTGRkViNLoP0ntbXvo-RrzAppEBiBHTUT90Al92Qm$ 
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>