简体   繁体   English

Spring Boot应用程序启动时出现IllegalAccessError

[英]IllegalAccessError with spring boot application start up

Getting Below error after upgrading spring boot version from 1.2.6.RELEASE to 1.3.4.RELEASE 将Spring Boot版本从1.2.6.RELEASE升级到1.3.4.RELEASE后出现以下错误

Earlier application was started fine with spring boot, but after upgrading the version application not starting up, any modification done to the latest version which I need to take care in my application to start. 较早的应用程序可以通过Spring Boot正常启动,但是在升级版本应用程序后,如果无法启动,则必须对最新版本进行任何修改,然后才能启动应用程序。

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:631)
    at org.springframework.boot.bind.PropertiesConfigurationFactory.doBindPropertiesToTarget(PropertiesConfigurationFactory.java:269)
    at org.springframework.boot.bind.PropertiesConfigurationFactory.bindPropertiesToTarget(PropertiesConfigurationFactory.java:241)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.bindToSpringApplication(ConfigFileApplicationListener.java:230)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:181)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:166)
    at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:152)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
    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.createAndRefreshContext(SpringApplication.java:330)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:134)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:126)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:75)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:55)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
    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.createAndRefreshContext(SpringApplication.java:330)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180)
    at com.gap.mosaic.trailerevent.ebo.integration.service.configuration.Application.main(Application.java:19)

Below are my gradle dependencies 以下是我的gradle依赖项

dependencies {
    compile "org.springframework.integration:spring-integration-core"
    compile "org.springframework.integration:spring-integration-jms"
    compile "org.springframework.integration:spring-integration-xml"

    compile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
    compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
    compile "org.springframework.boot:spring-boot-starter-integration:${springBootVersion}"

    compile "org.springframework.boot:spring-boot-starter:${springBootVersion}"
    compile "org.springframework.boot:spring-boot-autoconfigure:${springBootVersion}"
    compile "org.springframework.cloud:spring-cloud-config-client:1.0.2.RELEASE"

    compile "org.springframework:spring-jms"
    compile "org.springframework:spring-oxm"
    compile ("org.springframework.integration:spring-integration-mongodb"){
        exclude group: 'org.mongodb', module: 'mongo-java-driver'
    }

    compile "commons-io:commons-io:2.0.1"
    compile "org.apache.commons:commons-compress:1.4.1"
    compile "org.codehaus.castor:castor:${castor}"
    compile "xerces:xercesImpl:${xerces}"
    compile "xalan:xalan:${xalan}"
    compile "com.google.code.gson:gson:2.3.1"
    compile "org.skyscreamer:jsonassert:1.2.3"
    compile 'org.yaml:snakeyaml:1.8'

    compile "com.ibm:mq-jmqi:7.0.1"
    compile "dhbcore:dhbcore:7.0.1.5"
    compile "com.ibm.mqjms:com.ibm.mqjms:com.ibm.mqjms"
    compile group: 'jms', name: 'jms', version: 'jms'
    compile group: 'com.ibm.mq', name: 'com.ibm.mq', version: 'com.ibm.mq'
    compile group: 'com.ibm.mq.headers', name: 'com.ibm.mq.headers', version: 'com.ibm.mq.headers'
    compile group: 'com.ibm.mq.pcf', name: 'com.ibm.mq.pcf', version: 'com.ibm.mq.pcf'
    compile group: 'com.ibm', name: 'mq-commonservices', version: '7.0.1'
    compile 'org.mongodb:mongo-java-driver:3.2.0'

    testCompile("org.springframework.integration:spring-integration-test") {
        exclude group: 'org.objenesis', module: 'objenesis'
    }
    testCompile("org.mockito:mockito-core:1.9.5") {
        exclude group: 'org.hamcrest', module: 'hamcrest-core'
    }
    testCompile "com.github.fakemongo:fongo:2.0.4"
    testCompile ("com.mockrunner:mockrunner-jms:1.0.9") {
        exclude group: 'xerces', module: 'xerces'
    }
}

Any suggestions on this? 有什么建议吗?

Looks like you are overriding boot's Spring Framework version or you have an older spring version on the class path somehow. 看起来您是在覆盖引导的Spring Framework版本,或者以某种方式在类路径上具有较旧的spring版本。

addCollectionConverters was added to DefaultConversionService in Spring Framework 4.2.3. 在Spring Framework 4.2.3 addCollectionConverters添加到DefaultConversionService中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM