[英]IllegalAccessError with spring boot application start up
將Spring Boot版本從1.2.6.RELEASE升級到1.3.4.RELEASE后出現以下錯誤
較早的應用程序可以通過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)
以下是我的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'
}
}
有什么建議嗎?
看起來您是在覆蓋引導的Spring Framework版本,或者以某種方式在類路徑上具有較舊的spring版本。
在Spring Framework 4.2.3 addCollectionConverters
添加到DefaultConversionService
中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.