Hello

So I've been trying to solve and use AGAIN Spring Boot, after something that I don't know broke all my projects. I haven't been able to run a Spring Boot project since the release of 2.6.6, everytime that I

  1. Create a project on https://start.spring.io/
  2. Project: Maven
  3. Select the [Spring Web] dependency
  4. Run the project
  5. The error appears.

I Have done the following:

  • Deleted m2 folder
  • Use Gradle
  • Uninstalled IntelliJ
  • Tried the Spring Web project with vs-code
  • Tried the Spring Web project with openjdk-17, openjdk-11
  • Tried the Spring Web project with jdk-temurin 17.0.2.u8-1
  • Reinstalled the entire OS -> full clean installation of Java -> Intellij
  • Installed the OS on another Drive -> clean installation on Java -> Intellij
  • Run memtest = OK
  • Check drives for errors = OK

Current O.S: Linux archbox 5.17.1-arch1-1 Java environment: jdk11-openjdk (I've tried using jdk17 as default, but same error)

022-03-31 17:25:35.542 ERROR 8097 --- [           main] o.a.catalina.util.ExtensionValidator     : Failure loading extension [/home/user/.m2/repository/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar]

java.util.zip.ZipException: invalid entry CRC (expected 0x33d53c29 but got 0xadb3fec8)
    at java.base/java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:409) ~[na:na]
    at java.base/java.util.zip.ZipInputStream.read(ZipInputStream.java:198) ~[na:na]
    at java.base/java.util.jar.JarInputStream.read(JarInputStream.java:194) ~[na:na]
    at java.base/java.io.InputStream.readNBytes(InputStream.java:409) ~[na:na]
    at java.base/java.io.InputStream.readAllBytes(InputStream.java:346) ~[na:na]
    at java.base/java.util.jar.JarInputStream.checkManifest(JarInputStream.java:93) ~[na:na]
    at java.base/java.util.jar.JarInputStream.<init>(JarInputStream.java:85) ~[na:na]
    at java.base/java.util.jar.JarInputStream.<init>(JarInputStream.java:61) ~[na:na]
    at org.apache.catalina.util.ExtensionValidator.getManifest(ExtensionValidator.java:321) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.ExtensionValidator.addSystemResource(ExtensionValidator.java:174) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.ExtensionValidator.<clinit>(ExtensionValidator.java:90) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5044) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) ~[na:na]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) ~[na:na]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.apache.catalina.startup.Tomcat.start(Tomcat.java:486) ~[tomcat-embed-core-9.0.60.jar:9.0.60]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.initialize(TomcatWebServer.java:123) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.<init>(TomcatWebServer.java:104) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getTomcatWebServer(TomcatServletWebServerFactory.java:478) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:211) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:182) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:160) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577) ~[spring-context-5.3.18.jar:5.3.18]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) ~[spring-boot-2.6.6.jar:2.6.6]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) ~[spring-boot-2.6.6.jar:2.6.6]
    at com.example.what.WhatApplication.main(WhatApplication.java:21) ~[classes/:na]

The same error appears with the following JARS

2022-03-31 17:25:35.550 ERROR 8097 --- [           main] o.a.catalina.util.ExtensionValidator     : Failure loading extension [/home/user/.m2/repository/org/attoparser/attoparser/2.0.5.RELEASE/attoparser-2.0.5.RELEASE.jar]
2022-03-31 17:25:35.553 ERROR 8097 --- [           main] o.a.catalina.util.ExtensionValidator     : Failure loading extension [/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.2.2/jackson-databind-2.13.2.2.jar]
2022-03-31 17:25:35.565 ERROR 8097 --- [           main] o.a.catalina.util.ExtensionValidator     : Failure loading extension [/home/user/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.2/jackson-core-2.13.2.jar]
2022-03-31 17:25:35.568 ERROR 8097 --- [           main] o.a.catalina.util.ExtensionValidator     : Failure loading extension [/home/user/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.13.2/jackson-datatype-jdk8-2.13.2.jar]
2022-03-31 17:25:35.571 ERROR 8097 --- [           main] o.a.catalina.util.ExtensionValidator     : Failure loading extension [/home/user/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.13.2/jackson-module-parameter-names-2.13.2.jar]

I just dont know what else can I do ...

Maybe you could reproduce the errors if you delete m2 folder (backup it before) and then try with the steps above.

Any help would be AWESOME, because I have not been able to run any Spring Boot project since 2.6.6

Thanks!

Comment From: wilkinsona

Maven has corrupted those jar files when it downloaded them. Usually, you'd just delete them from Maven's local cache to force it to download them again. As you have already done that, you may also want to check your network and/or proxy configuration to see if it's contributing to the problem. If you're using a Maven proxy, it may be that the proxy is serving the same corrupted jar file to you each time Maven resolves the dependency. In that case, you will need to get the proxy's administrator to help.

Unfortunately, there's nothing more that we can do to help you here as the contents of those jar files and how they're downloaded is out of our control.

Comment From: Matheus3310

I dont understand how those jars can be corrupted and have the same sha's as in maven repository, Is that possible? Im not running a proxy. My network is not logging anything related to maven, neither im using Maven proxy.

Comment From: Matheus3310

Also found this random dude on twitter that got the same error after he deleted m2 https://twitter.com/ov3rflow1/status/1509694403425849353/photo/1

I asked him if he found the solution for the CRC entry problem and he said "no".

Comment From: wilkinsona

I dont understand how those jars can be corrupted

They definitely are corrupted. The CRC is a checksum that's stored in the zip's central directory header. Here's the entry for logback-classic's META-INF/MANIFEST.MF as displayed by zipinfo:

Central directory entry #2:
---------------------------

  META-INF/MANIFEST.MF

  offset of local header from start of archive:   39
                                                  (0000000000000027h) bytes
  file system or operating system of origin:      Unix
  version of encoding software:                   2.0
  minimum file system compatibility required:     MS-DOS, OS/2 or NT FAT
  minimum software version required to extract:   2.0
  compression method:                             deflated
  compression sub-type (deflation):               normal
  file security status:                           not encrypted
  extended local header:                          no
  file last modified on (DOS date/time):          2022 Mar 5 19:45:00
  32-bit CRC value (hex):                         33d53c29
  compressed size:                                1321 bytes
  uncompressed size:                              6908 bytes
  length of filename:                             20 characters
  length of extra field:                          0 bytes
  length of file comment:                         0 characters
  disk number on which file begins:               disk 1
  apparent file type:                             binary
  Unix file attributes (100644 octal):            -rw-r--r--
  MS-DOS file attributes (00 hex):                none

  There is no file comment.

As you can see, the CRC is 33d53c29 which is what the JDK expected when trying to read the manifest:

invalid entry CRC (expected 0x33d53c29 but got 0xadb3fec8)

So the jar file is definitely corrupted as the CRC of the entry data for META-INF/MANIFEST.MF does not match the CRC in the header.

and have the same sha's as in maven repository, Is that possible?

This is the first time you've mentioned the SHAs so it's hard to comment. Collisions with MD5 and SHA-1 are technically possible, although I think it's incredibly unlikely that random corruption would result in a collision.

Spring Boot isn't involved at all here. The jar file's being read from Maven's cache . It was written there by Maven. It's being read by some code in the JDK that's being called by Tomcat. I would expect the following minimal code to recreate the problem:

try (JarInputStream input = new JarInputStream(new FileInputStream("/home/user/.m2/repository/ch/qos/logback/logback-classic/1.2.11/logback-classic-1.2.11.jar"))) {
    System.out.println(input.getManifest());
}
catch (IOException ex) {
    throw new RuntimeException(ex);
}

Perhaps this will help you to identify the cause but I don't think there's anything more that we can do to help you here.