【问题标题】:issue with spring boot while upgrading to 1.3.0.RELEASE升级到 1.3.0.RELEASE 时出现 Spring Boot 问题
【发布时间】:2017-12-20 02:41:54
【问题描述】:

您好,我刚刚升级到 spring boot 1.3.0.RELEASE 并且在再次运行时遇到这个奇怪的错误

14:43:52.503 [main] INFO  c.test.whf.service.HfServices - Starting up....
Exception in thread "main" java.lang.IllegalAccessError: tried to access method org.springframework.core.convert.support.DefaultConversionService.addCollectionConverters(Lorg/springframework/core/convert/converter/ConverterRegistry;)V from class org.springframework.boot.bind.RelaxedConversionService
    at org.springframework.boot.bind.RelaxedConversionService.<init>(RelaxedConversionService.java:52)
    at org.springframework.boot.bind.RelaxedDataBinder.modifyProperties(RelaxedDataBinder.java:148)
    at org.springframework.boot.bind.RelaxedDataBinder.doBind(RelaxedDataBinder.java:128)
    at org.springframework.validation.DataBinder.bind(DataBinder.java:715)
    at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:267)
    at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:240)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.bindToSpringApplication(ConfigFileApplicationListener.java:220)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:171)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:161)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:146)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:119)
    at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:111)
    at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:65)
    at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54)
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:315)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:295)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)
    at com.wellmanage.whf.service.HfServices.main(HfServices.java:97)

我的代码也没有其他更改,不确定是什么原因造成的。

app类就这么简单

  SpringApplication.run(HfServices.class, args);

请帮忙...

【问题讨论】:

  • 我在使用 Spring Boot 1.3.0 和 Spring 4.2.2 时遇到了同样的错误。升级到 Spring 4.2.3 为我解决了这个问题。

标签: spring spring-boot


【解决方案1】:

该方法已添加到 Spring Framework 中,并且您正在项目中明确覆盖该版本。 不要那样做!

Spring Boot 正在为您管理这个,您应该真的让它决定要使用的 Spring Framework 版本。

【讨论】:

  • 感谢 Stephane,由于该版本中的修复(在里程碑 1.3.0 版本中有效),所以现在我们应该让 spring boot 决定底层spring框架的版本?
  • 总是如此。如果您需要一个 newer 版本(就像您所做的那样),那很好,但是一旦升级 Spring Boot,您必须记住删除该覆盖并让 Spring Boot 再次选择它。该方法是在 4.2.3 中添加的
  • 啊,好的,谢谢,似乎对 logback 进行了一些更改,现在我的运行因一些 logback 问题而失败,让我检查并解决..
【解决方案2】:

我也遇到了这个错误。我们目前正在 WebLogic 中运行我们的应用程序,并计划迁移到云中,因此也使它们能够使用 Spring Boot 运行。 要修复它,我需要将它添加到 webapp/WEB-INF/weblogic.xml :

<wls:container-descriptor>
    <wls:prefer-application-packages>
        <wls:package-name>org.springframework.*</wls:package-name>            
    </wls:prefer-application-packages>
</wls:container-descriptor>

【讨论】:

    猜你喜欢
    • 2022-12-04
    • 2021-09-06
    • 1970-01-01
    • 1970-01-01
    • 2021-10-15
    • 2020-04-26
    • 2021-03-02
    • 2015-05-24
    • 1970-01-01
    相关资源
    最近更新 更多