You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2022/07/30 12:01:33 UTC

[GitHub] [tomcat-jakartaee-migration] gregorkistler opened a new issue, #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

gregorkistler opened a new issue, #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29

   Hi,
   
   with the release of version 1.0.1 of the Tomcat Migration Tool for Jakarta EE I'm having some issues with a couple of jar files in my project which cannot be migrated due to an exception. Same jar(s) can be migrated using version 1.0.0:
   
   ### jakartaee-migration-1.0.1-shaded.jar
   ```
   $ java -jar jakartaee-migration-1.0.1-shaded.jar jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta 
   Performing migration from source [/jna-platform-4.5.1.jar] to destination [/jna-platform-4.5.1.jar.jakarta] with Jakarta EE specification profile [TOMCAT]
   Migration starting for archive [jna-platform-4.5.1.jar] using streaming
   Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF: 16b8446c instead of 4535229
   	at org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.handleSizesAndCrc(ZipArchiveOutputStream.java:718)
   	at org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.closeArchiveEntry(ZipArchiveOutputStream.java:607)
   	at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:228)
   	at org.apache.tomcat.jakartaee.Migration.migrateStream(Migration.java:285)
   	at org.apache.tomcat.jakartaee.Migration.migrateFile(Migration.java:197)
   	at org.apache.tomcat.jakartaee.Migration.execute(Migration.java:163)
   	at org.apache.tomcat.jakartaee.MigrationCLI.main(MigrationCLI.java:94)
   	Suppressed: java.io.IOException: This archive contains unclosed entries.
   		at org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.finish(ZipArchiveOutputStream.java:534)
   		at org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.close(ZipArchiveOutputStream.java:1090)
   		at org.apache.tomcat.jakartaee.Migration.migrateArchiveStreaming(Migration.java:214)
   		... 4 more
   ```
   
   ### jakartaee-migration-1.0.0-shaded.jar
   ```
   $ java -jar jakartaee-migration-1.0.0-shaded.jar jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta 
   Performing migration from source [/jna-platform-4.5.1.jar] to destination [/jna-platform-4.5.1.jar.jakarta] with Jakarta EE specification profile [TOMCAT]
   Migration starting for archive [jna-platform-4.5.1.jar] using streaming
   Migration finished for archive [jna-platform-4.5.1.jar]
   Migration completed successfully in [529] milliseconds
   ```
   
   Java version: OpenJDK 11 as well as OpenJDK 17
   OS version: Ubuntu 22.04 as well as 20.04
   
   Simple reproducer:
   1. fire up a OpenJDK Docker container, e.g. `docker run -it --rm openjdk:11 bash`
   2. download an affected jar like [Java Native Access Platform 4.5.1](https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/4.5.1/jna-platform-4.5.1.jar)
   3. download [Tomcat Migration Tool for Jakarta EE 1.0.1](https://dlcdn.apache.org/tomcat/jakartaee-migration/v1.0.1/binaries/jakartaee-migration-1.0.1-shaded.jar)
   4. try to migrate the jar, e.g. `java -jar jakartaee-migration-1.0.1-shaded.jar jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] aooohan closed issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
aooohan closed issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] nissan4x4 commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
nissan4x4 commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1219219413

   Hi Han,
   
   Thanks for that, but my OS is windows not Unix.
   
    
   
   From: Han Li ***@***.***> 
   Sent: Thursday, 18 August 2022 6:03 PM
   To: apache/tomcat-jakartaee-migration
   ***@***.***>
   Cc: nissan4x4 ***@***.***>; Mention
   ***@***.***>
   Subject: Re: [apache/tomcat-jakartaee-migration] Exception in thread "main"
   java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF
   (Issue #29)
   
    
   
   Hi, @nissan4x4 <https://github.com/nissan4x4> 
   jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz
   <https://github.com/apache/tomcat-jakartaee-migration/files/9371552/jakartae
   e-migration-1.0.2-SNAPSHOT-bin.tar.gz> 
   
   You can use this temporary tool to test whether the migration of your war
   package works.
   
   *	tar -zxvf jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz
   *	cd jakartaee-migration-1.0.2-SNAPSHOT/lib
   *	java -jar jakartaee-migration-1.0.2-SNAPSHOT.jar your-war.war
   target-your-war.war OR java -jar your-war-dir target-dir
   
   Note: This is not a release version, it has nothing to do with tc offical,
   it is only for testing.
   
   -
   Reply to this email directly, view it on GitHub
   <https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment
   -1219162105> , or unsubscribe
   <https://github.com/notifications/unsubscribe-auth/A2STHNVPDDWEZZTMLWK73CLVZ
   XU2PANCNFSM55DDYDUA> .
   You are receiving this because you were mentioned.
   <https://github.com/notifications/beacon/A2STHNXFZSGOV6GYUOAICMLVZXU2PA5CNFS
   M55DDYDUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJCVO76I
   .gif> Message ID:
   ***@***.***
   ***@***.***> >
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] aooohan commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
aooohan commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1200600710

   >  I've meanwhile switched back to version 1.0.0 which works as intended.
   
   Sure. The difference between 1.0.0 and 1.0.1 is that in order to solve #20, the logic was modified to use common-compression instead of JDK's zip implementation.
   
   Hi,@gregorkistler. 
   I've tried to fix the problem, can you test it with this fixed version?
   branch: https://github.com/aooohan/tomcat-jakartaee-migration/tree/test_deflated
   OR
   jar:
   [jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz](https://github.com/apache/tomcat-jakartaee-migration/files/9230352/jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz)
    
   1.`tar -zxvf  jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz`
   2.`cd jakartaee-migration-1.0.2-SNAPSHOT/lib`
   3.`java -jar jakartaee-migration-1.0.2-SNAPSHOT.jar jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta`  
   
   Note: This is not a release version, it has nothing to do with tc offical, it is only for testing.
   
   Thanks 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] aooohan commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
aooohan commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1219162105

   Hi, @nissan4x4 
   [jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz](https://github.com/apache/tomcat-jakartaee-migration/files/9371552/jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz)
   
   You can use this temporary tool to test whether the migration of your war package works.
   
   - `tar -zxvf jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz`
   - `cd jakartaee-migration-1.0.2-SNAPSHOT/lib`
   - `java -jar jakartaee-migration-1.0.2-SNAPSHOT.jar your-war.war target-your-war.war` **OR**` java -jar your-war-dir target-dir`
   
   **Note**: This is not a release version, it has nothing to do with tc offical, it is only for testing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] gregorkistler commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
gregorkistler commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1200761127

   > Hi,@gregorkistler. I've tried to fix the problem, can you test it with this fixed version? branch: https://github.com/aooohan/tomcat-jakartaee-migration/tree/test_deflated OR jar: [jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz](https://github.com/apache/tomcat-jakartaee-migration/files/9230380/jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz)
   > 
   > 1.`tar -zxvf jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz` 2.`cd jakartaee-migration-1.0.2-SNAPSHOT/lib` 3.`java -jar jakartaee-migration-1.0.2-SNAPSHOT.jar jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta`
   > 
   > Note: This is not a release version, it has nothing to do with tc offical, it is only for testing.
   > 
   > Thanks
   
   LGTM
   
   No exception any longer on any of the used jars. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] gregorkistler commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
gregorkistler commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1200444166

   > It's a little inefficient, but it'll work.
   
   Thank you. Yes it works but as you've mentioned it's quite inefficient - takes ~150s instead of ~500ms for this specific jar and my project contains roughly 20 jar files 😅
   I've meanwhile switched back to version 1.0.0 which works as intended.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] aooohan commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
aooohan commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1200766146

   > > Hi,@gregorkistler. I've tried to fix the problem, can you test it with this fixed version? branch: https://github.com/aooohan/tomcat-jakartaee-migration/tree/test_deflated OR jar: [jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz](https://github.com/apache/tomcat-jakartaee-migration/files/9230380/jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz)
   > > 1.`tar -zxvf jakartaee-migration-1.0.2-SNAPSHOT-bin.tar.gz` 2.`cd jakartaee-migration-1.0.2-SNAPSHOT/lib` 3.`java -jar jakartaee-migration-1.0.2-SNAPSHOT.jar jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta`
   > > Note: This is not a release version, it has nothing to do with tc offical, it is only for testing.
   > > Thanks
   > 
   > LGTM
   > 
   > No exception any longer on any of the used jars. Thanks!
   
   Thanks for the test. ;)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] aooohan commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
aooohan commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1200394952

   You can do it like this: java -jar jakartaee-migration-1.0.1-shaded.jar -zipInMemory jna-platform-4.5.1.jar jna-platform-4.5.1.jar.jakarta
   
   It's a little inefficient, but it'll work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] aooohan commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
aooohan commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1219238170

   > but my OS is windows not Unix. 
   
   Sorry, I was careless.
   [jakartaee-migration-1.0.2-SNAPSHOT-bin.zip](https://github.com/apache/tomcat-jakartaee-migration/files/9372150/jakartaee-migration-1.0.2-SNAPSHOT-bin.zip)
   
   The steps are the same, first you need to unzip the package, then go to the lib folder and execute the jakartaee-migration-1.0.2-SNAPSHOT.jar file(the command is the same).
   
   JAVA_HOME/bin/java.exe -jar jakartaee-migration-1.0.2-SNAPSHOT.jar your-war.war target-your-war.war
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] nissan4x4 commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
nissan4x4 commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1219283706

   Thank you very much Han. That worked perfectly.
   
    
   
    
   
   From: Han Li ***@***.***> 
   Sent: Thursday, 18 August 2022 7:17 PM
   To: apache/tomcat-jakartaee-migration ***@***.***>
   Cc: nissan4x4 ***@***.***>; Mention ***@***.***>
   Subject: Re: [apache/tomcat-jakartaee-migration] Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF (Issue #29)
   
    
   
   but my OS is windows not Unix.
   
   Sorry, I was careless.
   jakartaee-migration-1.0.2-SNAPSHOT-bin.zip <https://github.com/apache/tomcat-jakartaee-migration/files/9372150/jakartaee-migration-1.0.2-SNAPSHOT-bin.zip> 
   
   The steps are the same, first you need to unzip the package, then go to the lib folder and execute the jakartaee-migration-1.0.2-SNAPSHOT.jar file(the command is the same).
   
   JAVA_HOME/bin/java.exe -jar jakartaee-migration-1.0.2-SNAPSHOT.jar your-war.war target-your-war.war
   
   —
   Reply to this email directly, view it on GitHub <https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1219238170> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/A2STHNUAP5UW5I2F5EUGOL3VZX5RZANCNFSM55DDYDUA> .
   You are receiving this because you were mentioned.  <https://github.com/notifications/beacon/A2STHNXKQCO56MTUDUDBHYTVZX5RZA5CNFSM55DDYDUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOJCWBSGQ.gif> Message ID: ***@***.*** ***@***.***> >
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] [tomcat-jakartaee-migration] nissan4x4 commented on issue #29: Exception in thread "main" java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF

Posted by GitBox <gi...@apache.org>.
nissan4x4 commented on issue #29:
URL: https://github.com/apache/tomcat-jakartaee-migration/issues/29#issuecomment-1219144189

   Hi,  @aooohan. I am experiencing the same issue as @gregorkistler with the CRC.
   ```
   18-Aug-2022 14:55:06.339 WARNING [Catalina-utility-1] org.apache.catalina.startup.HostConfig.migrateLegacyApp Migration failure
   	java.util.zip.ZipException: Bad CRC checksum for entry META-INF/MANIFEST.MF: 277a0274 instead of 5cfc51fe
   		at org.apache.tomcat.jakartaee.commons.compress.archivers.zip.ZipArchiveOutputStream.handleSizesAndCrc(ZipArchiveOutputStream.java:718)
   
   ```
   OS is Windows 2019 server
   JAVA 8 (jre-8u341-windows-i586)
   Tomcat 10.0.23
   
   I'm having TC do the migration by placing the *.war into the webapps-javaee folder.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org