升级到1.3.0.RELEASE时弹出启动的问题

时间:2015-11-19 09:23:19

标签: spring 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);

请帮忙......

2 个答案:

答案 0 :(得分:12)

在Spring Framework中添加了该方法,您将在项目中明确地覆盖该版本。 不要那样做!

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

答案 1 :(得分:0)

我也遇到了这个错误。我们目前正在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>