Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipException: zip END header not found in prepareMergedJarsDir #201

Open
duc0 opened this issue Nov 2, 2021 · 1 comment
Open

ZipException: zip END header not found in prepareMergedJarsDir #201

duc0 opened this issue Nov 2, 2021 · 1 comment

Comments

@duc0
Copy link

duc0 commented Nov 2, 2021

I'm getting this exception. Any ideas how to troubleshoot this.


Caused by: java.util.zip.ZipException: zip END header not found
        at org.beryx.jlink.util.Util.isEmptyJar(Util.groovy:260)
        at org.beryx.jlink.util.DependencyManager$_closure1$_closure18.doCall(DependencyManager.groovy:70)
        at org.beryx.jlink.util.DependencyManager$_closure1$_closure18.call(DependencyManager.groovy)
        at org.beryx.jlink.util.DependencyManager$_closure1.doCall(DependencyManager.groovy:68)
        at org.beryx.jlink.util.DependencyManager$_closure1.call(DependencyManager.groovy)
        at org.beryx.jlink.util.DependencyManager.<init>(DependencyManager.groovy:67)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at org.beryx.jlink.impl.PrepareMergedJarsDirTaskImpl.execute(PrepareMergedJarsDirTaskImpl.groovy:42)
        at org.beryx.jlink.PrepareMergedJarsDirTask.createMergedModuleAction(PrepareMergedJarsDirTask.groovy:93)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
@siordache
Copy link
Member

siordache commented Nov 2, 2021

It seems that one of your dependencies is not a valid jar. To troubleshoot put this into your root build.gradle:

allprojects {
    task showdeps {
        doFirst {
            configurations.runtimeClasspath.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
                def jarFiles = ([dep] as Set).collect{ it.moduleArtifacts*.file }.flatten() as Set
                jarFiles.each { f ->
                    println "\n$f"
                    println "\tfile length: ${f.length()}"
                    def zipFile = new java.util.zip.ZipFile(f)
                    println "\tjar file entries: ${zipFile.size()}"
                }
            }
        }
    }
}

Then execute ./gradlew showdeps. I expect it to crash right after printing the path to the problematic dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants