Mark Adamcin created SLING-11975:
------------------------------------

             Summary: org.apache.sling.launchpad.base.jar fails to load on jdk 
11.0.20 because it has malformed Zip64 extra fields
                 Key: SLING-11975
                 URL: https://issues.apache.org/jira/browse/SLING-11975
             Project: Sling
          Issue Type: Bug
          Components: Launchpad
    Affects Versions: Launchpad Base 2.7.6
            Reporter: Mark Adamcin


I ran into an error when trying to run AEM quickstart locally after upgrading 
my jdk to 11.0.20 ([release 
notes|https://www.oracle.com/java/technologies/javase/11-0-20-relnotes.html]):
{quote}core-libs/java.util.jar
*[➜|https://www.oracle.com/java/technologies/javase/11-0-20-relnotes.html#JDK-8302483]*
 *Improved ZIP64 Extra Field Validation* (JDK-8302483 (not 
public)){{{}java.util.zip.ZipFile{}}} has been updated to provide additional 
validation of ZIP64 extra fields when opening a ZIP file. This validation may 
be disabled by setting the system property 
{{jdk.util.zip.disableZip64ExtraFieldValidation}} to {{{}true{}}}.{quote}
it manifested for me as an exception in {{logs/stderr.log}} :
{code:java}
20.07.2023 07:59:22.568 *ERROR* [main] Cannot launch: Cannot install 
jar:file:/opt/code/aem/quickstart/target/author-54594/crx-quickstart/app/cq-quickstart-6.6.0-SNAPSHOT-standalone-quickstart.jar!/resources/org.apache.sling.launchpad.base.jar
 for use
20.07.2023 07:59:22.568 *ERROR* [main] java.util.zip.ZipException: Invalid CEN 
header (invalid zip64 extra data field size)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1736)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$Source.checkExtraFields(ZipFile.java:1254)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1701)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1430)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1393)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:742)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:859)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile.<init>(ZipFile.java:257)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.zip.ZipFile.<init>(ZipFile.java:186)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.jar.JarFile.<init>(JarFile.java:348)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.jar.JarFile.<init>(JarFile.java:319)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.util.jar.JarFile.<init>(JarFile.java:285)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
org.apache.sling.commons.osgi.bundleversion.FileBundleVersionInfo.<init>(FileBundleVersionInfo.java:40)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
org.apache.sling.launchpad.base.shared.Loader.installLauncherJar(Loader.java:172)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
org.apache.sling.launchpad.app.Main.doStart(Main.java:382)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
org.apache.sling.launchpad.app.Main.doStart(Main.java:347)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
java.base/java.lang.reflect.Method.invoke(Method.java:566)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
com.adobe.granite.quickstart.base.impl.exec.Bootstrap.run(Bootstrap.java:107)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
com.adobe.granite.quickstart.base.impl.Quickstart.run(Quickstart.java:272)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
com.adobe.granite.quickstart.base.impl.Main.<init>(Main.java:918)
20.07.2023 07:59:22.568 *ERROR* [main]  at 
com.adobe.granite.quickstart.base.impl.Main.main(Main.java:980)
MAIN process: shutdown hook
MAIN process: exiting {code}
This appears to be an issue with the org.apache.sling.launchpad.base 
7.0.3-2.7.6 jar specifically:
{code:java}
$ jar -tf 
~/.m2/repository/org/apache/sling/org.apache.sling.launchpad.base/7.0.3-2.7.6/org.apache.sling.launchpad.base-7.0.3-2.7.6.jar
java.util.zip.ZipException: Invalid CEN header (invalid zip64 extra data field 
size)
        at java.base/java.util.zip.ZipFile$Source.zerror(ZipFile.java:1736)
        at 
java.base/java.util.zip.ZipFile$Source.checkExtraFields(ZipFile.java:1254)
        at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1701)
        at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1430)
        at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1393)
        at 
java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:742)
        at 
java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:859)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:257)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:186)
        at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:157)
        at jdk.jartool/sun.tools.jar.Main.list(Main.java:1499)
        at jdk.jartool/sun.tools.jar.Main.run(Main.java:380)
        at jdk.jartool/sun.tools.jar.Main.main(Main.java:1680) {code}
The issue is that it was created with Bnd 5.1.1 (according to the jar 
manifest), and the Bnd’s treatment of extra fields was corrected in 5.3 
[https://github.com/bndtools/bnd/issues/4507#issuecomment-771925051]
 I believe a new version of org.apache.sling.launchpad.base should be released 
after upgrading maven-bundle-plugin to at least 5.1.5 ([based on its bndlib 
dependency being upgraded to 
6.20|https://github.com/apache/felix-dev/commit/b29ea9a5d6dc8662dc0c960eff199c18fcd6b5e4]).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to