Quarkus: Cannot package with quarkus-hibernate-orm-panache extension

Created on 17 Jul 2020  路  8Comments  路  Source: quarkusio/quarkus

Describe the bug
(Describe the problem clearly and concisely.)
I can not package with quarkus-hibernate-orm-panache extension in pom.xml, after i remove quarkus-hibernate-orm-panache from pom.xml, i can package with ./mvnw package or compile with ./mvnw package -Pnative. It's ok with only quarkus-hibernate-orm in pom.xml.
Expected behavior
(Describe the expected behavior clearly and concisely.)
Get a fast-jar package or native package
Actual behavior
(Describe the actual behavior clearly and concisely.)
Got a java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)

To Reproduce
Steps to reproduce the behavior:

  1. add quarkus-hibernate-orm-panache extension to project
  2. ./mvnw package or ./mvnw package -Pnative

Configuration

# Add your application.properties here, if applicable.
   <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-hibernate-orm</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-hibernate-orm-panache</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-smallrye-jwt</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-jdbc-postgresql</artifactId>
    </dependency>

Screenshots

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.0.Final:build (default) on project phm-with-quarkus: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.deployment.pkg.steps.JarResultBuildStep#buildRunnerJar threw an exception: java.lang.RuntimeException: java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.filterZipFile(JarResultBuildStep.java:953)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.copyLibraryJars(JarResultBuildStep.java:824)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.doLegacyThinJarGeneration(JarResultBuildStep.java:788)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.buildLegacyThinJar(JarResultBuildStep.java:403)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.buildRunnerJar(JarResultBuildStep.java:176)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]     at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)
[ERROR]     at java.base/java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:268)
[ERROR]     at java.base/java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:193)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.filterZipFile(JarResultBuildStep.java:941)
[ERROR]     ... 16 more
[ERROR]     Suppressed: java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)
[ERROR]         at java.base/java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:268)
[ERROR]         at java.base/java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:361)
[ERROR]         at java.base/java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)
[ERROR]         at java.base/java.util.zip.ZipOutputStream.close(ZipOutputStream.java:378)
[ERROR]         at io.quarkus.deployment.pkg.steps.JarResultBuildStep.filterZipFile(JarResultBuildStep.java:950)

Environment (please complete the following information):
I tried different JDKincluding openJDK 11, openJDK 13, GraalVM graalvm-ce-java11-20.1.0, all of them can trigger this error
Additional context
(Add any other context about the problem here.)
However everything works fine with ./mvnw quarkus:dev and I can get a package if i use fat-jar with

quarkus.package.uber-jar=true 
arehibernate-orm arepanache arepersistence kinbug triaginvalid

Most helpful comment

Thanks for your great thinking! With your help, I finally confirmed that this is a problem between my libz.so.1 and my JDK. After I put another libz.so.1 from another OS into JAVA_HOME/lib/, the problem solved. I will send a email to Clear linux developers, if i can find more useful information about their optimized libraries and jdk.

All 8 comments

/cc @FroMage, @loicmathieu
/cc @gsmet, @Sanne

I couldn't reproduce this. Is there any chance you can upload the project that is causing problems to Github?

phm-with-quarkus.zip
@geoand
Maybe this problem is OS related. I use Clear OS linux offered by Intel, the JDK package comes from system repository.
I tried with a Mac mojave with brew install openJDK 11, it packaged normally.
I want to borrow a ubuntu server to test now.

I use Ubuntu and your reproducer project perfectly, so seriously doubt this is a Quarkus issue.

@rsvoboda do you or anyone you know have any ClearOS experience?

I tried GraalVM with the same problem. May be this is just a problem with the Clear OS optimized C library( libz.so.1 was optimized by intel ), it seems nothing to do with quarkus, sorry to bother you.

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.6.0.Final:build (default) on project phm-platform: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.deployment.pkg.steps.JarResultBuildStep#buildRunnerJar threw an exception: java.lang.RuntimeException: java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.filterZipFile(JarResultBuildStep.java:953)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.copyLibraryJars(JarResultBuildStep.java:824)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.doLegacyThinJarGeneration(JarResultBuildStep.java:788)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.buildLegacyThinJar(JarResultBuildStep.java:403)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.buildRunnerJar(JarResultBuildStep.java:176)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]     at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)
[ERROR]     at java.base/java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:268)
[ERROR]     at java.base/java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:193)
[ERROR]     at io.quarkus.deployment.pkg.steps.JarResultBuildStep.filterZipFile(JarResultBuildStep.java:941)
[ERROR]     ... 16 more
[ERROR]     Suppressed: java.util.zip.ZipException: invalid entry compressed size (expected 446 but got 448 bytes)
[ERROR]         at java.base/java.util.zip.ZipOutputStream.closeEntry(ZipOutputStream.java:268)
[ERROR]         at java.base/java.util.zip.ZipOutputStream.finish(ZipOutputStream.java:361)
[ERROR]         at java.base/java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:238)
[ERROR]         at java.base/java.util.zip.ZipOutputStream.close(ZipOutputStream.java:378)
[ERROR]         at io.quarkus.deployment.pkg.steps.JarResultBuildStep.filterZipFile(JarResultBuildStep.java:950)
[ERROR]         ... 16 more

No bother.

What you say makes sense, it's just that I don't see how we could provide any meaningful output information in Quarkus as this looks to be a deep JDK / FS issue.

I'l close this as we can't really do much about in Quarkus.

Thanks in any case for reporting.

hi! While I agree this could possibly be a JDK issue, you could also just have a corrupt jar file.

If you could figure out which jar it was attempting to open, try verifying the file with a simple zip verification tool, or just rebuild it / redownload it.

Thanks for your great thinking! With your help, I finally confirmed that this is a problem between my libz.so.1 and my JDK. After I put another libz.so.1 from another OS into JAVA_HOME/lib/, the problem solved. I will send a email to Clear linux developers, if i can find more useful information about their optimized libraries and jdk.

Was this page helpful?
0 / 5 - 0 ratings