【问题标题】:Migrate spring-boot app from 2.3.5 to 2.4.0将 spring-boot 应用程序从 2.3.5 迁移到 2.4.0
【发布时间】:2020-12-12 02:05:21
【问题描述】:

我将一个 spring-boot 应用从 2.3.5 迁移到 2.4.0 并部署在 tomcat 上。

应用无法启动:

Caused by: java.lang.NullPointerException
    at **org.springframework.core.io.support.SpringFactoriesLoader.loadSpringFactories(SpringFactoriesLoader.java:136)**
    at org.springframework.core.io.support.SpringFactoriesLoader.loadFactoryNames(SpringFactoriesLoader.java:132)
    at org.springframework.core.io.support.SpringFactoriesLoader.loadFactories(SpringFactoriesLoader.java:101)
    at org.springframework.boot.logging.LoggingSystemFactory.lambda$fromSpringFactories$0(LoggingSystemFactory.java:44)
    at org.springframework.boot.logging.DelegatingLoggingSystemFactory.getLoggingSystem(DelegatingLoggingSystemFactory.java:41)

我检查了https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.4-Release-Notes#upgrading-from-spring-boot-23,但没有发现任何明显的问题。

有人遇到过类似的问题并解决了吗?

在 2.4.1 中修复

谢谢

【问题讨论】:

  • 也许考虑在 github 上创建一个关于它的 bug 问题。它看起来与日志记录相关,因此可能包括您的日志记录配置。
  • 谢谢,问题已在 2.4.1 中修复

标签: java spring spring-boot


【解决方案1】:

这是由于此提交中修复的错误https://github.com/spring-projects/spring-framework/commit/a0544e78ea2b4736122ff0dffaf6fe0c729b32a1#diff-5cfb6e321ece4799e72ea0af1a677eb04698e85458408dfd21e1b8ca2d41b5b0

该修复程序在 Spring 5.3.2 中可用,并且我已确认它在使用该版本时有效。

如果您使用 Maven,您可以在 <dependencyManagement>-section 中的 spring-boot-dependencies BOM 上方导入 https://mvnrepository.com/artifact/org.springframework/spring-framework-bom/5.3.2

【讨论】:

    猜你喜欢
    • 2021-03-08
    • 1970-01-01
    • 2021-03-08
    • 2014-03-08
    • 1970-01-01
    • 2019-01-22
    • 2021-09-15
    • 1970-01-01
    • 2012-04-08
    相关资源
    最近更新 更多