I'm trying to upgrade spring boot version to 2.6.6 from 2.2.x, I got ClassNotFoundException: org.springframework.core.metrics.ApplicationStartup. The pom.xml below:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.6</version>
<relativePath/>
</parent>
The error stack trace below:
Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/metrics/ApplicationStartup
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:228)
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:241)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
at com.sams.clubops.receiptcheck.transactionaudit.AuditApplication.main(AuditApplication.java:19)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.metrics.ApplicationStartup
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 5 more
I don't know if there is someting confict with this version. I wanna get some help, thanks.
Comment From: bclozel
The ApplicationStartup class still belongs to this package and is shipped with Spring Framework (namely the "spring-core" module). This is likely to be a corrupted Jar in your application. For more help on this, please ask a question on StackOverflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.