Я получаю сообщение об ошибке "java.lang.IllegalArgumentException: невозможно создать экземпляр класса фабрики: org.springframework.boot.autoconfigure.AutoConfigurationImportFilter", когда я пытаюсь использовать зависимость (agile-sdk), скомпилированную с версией "2.0.3"в 2.1.7 весенний загрузочный проект.
Я попытался изменить версию проекта весенней загрузки с 2.1.7 на 2.0.3, и все работает нормально.Интересно, в чем заключается несовместимость между зависимостью (agile-sdk), скомпилированной с 2.0.3, и моим целевым проектом с версией 2.1.7.
Вот мои зависимости build.gradle
buildscript {
ext{
springBootVersion = '2.1.7.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("com.kenshoo:gradle-fpm:$gradlefpm")
}
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-actuator')
compile('org.springframework.boot:spring-boot-starter-web')
compile group: 'io.springfox', name: 'springfox-swagger2', version: springfox_version
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: springfox_version
compile group: 'org.apache.commons', name: 'commons-compress', version: apache_commons_compress_version
compile group: 'org.apache.commons', name: 'commons-lang3', version: apache_commons_lang_version
compile group: 'commons-io', name: 'commons-io', version: commons_io_version
compile group: 'com.amazonaws', name: 'aws-java-sdk-core', version: aws_version
compile group: 'com.amazonaws', name: 'aws-java-sdk-s3', version:aws_version
implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation "com.*.ps:agile-sdk:$agilesdkVersion"
providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat'
runtime group: 'org.codehaus.groovy', name: 'groovy', version: groovy_version
testCompile group: 'org.assertj', name: 'assertj-core', version: assertj_version
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testCompile 'org.codehaus.groovy:groovy-all:2.4.13'
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
testCompile group: 'cglib', name: 'cglib-nodep', version: '3.2.5'
testCompile group: 'org.powermock', name: 'powermock-core', version: '1.7.1'
testCompile group: 'org.powermock', name: 'powermock-module-junit4', version: '1.7.1'
testCompile group: 'org.powermock', name: 'powermock-module-junit4-rule-agent', version: '1.7.1'
testCompile group: 'org.powermock', name: 'powermock-api-mockito2', version: '1.7.1'
}
2019-09-26T14:43:31.284|INFO |*|*.Application||Starting Application on M-C02TF1QFGTFM with PID 50965 (/** in /**)
2019-09-26T14:43:31.289|INFO |*|*.Application||No active profile set, falling back to default profiles: default
2019-09-26T14:43:31.343|INFO |*|o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext||Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@112f364d: startup date [Thu Sep 26 14:43:31 CDT 2019]; root of context hierarchy
2019-09-26T14:43:31.831|ERROR|*|o.s.boot.SpringApplication||Application run failed
java.lang.IllegalArgumentException: Unable to instantiate factory class: org.springframework.boot.autoconfigure.AutoConfigurationImportFilter
at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:163)
at org.springframework.core.io.support.SpringFactoriesLoader.loadFactories(SpringFactoriesLoader.java:101)
at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getAutoConfigurationImportFilters(AutoConfigurationImportSelector.java:266)
at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.filter(AutoConfigurationImportSelector.java:237)
at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.selectImports(AutoConfigurationImportSelector.java:102)
at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.process(AutoConfigurationImportSelector.java:386)
at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:830)
at org.springframework.context.annotation.ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:563)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:188)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
at *.Application.main(Application.java:23)
Caused by: java.lang.IllegalArgumentException: Class [org.springframework.boot.autoconfigure.condition.OnBeanCondition] is not assignable to [org.springframework.boot.autoconfigure.AutoConfigurationImportFilter]
at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:158)
... 19 common frames omitted
2019-09-26T14:43:31.832|INFO |*|o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext||Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@112f364d: startup date [Thu Sep 26 14:43:31 CDT 2019]; root of context hierarchy
Задача: bootRun FAILED
FAILURE: сборка не удалась с исключением.
Что пошло не так: выполнение задачи ': bootRun' не удалось.
Обработка 'команды' /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java '' завершена с ненулевым значением выхода 1
Попробуйте: Запустите с параметром --stacktrace, чтобы получить трассировку стека.Запустите с параметром --info или --debug, чтобы получить больше вывода журнала.Запустите --scan, чтобы получить полное представление.
Получите дополнительную помощь по https://help.gradle.org
СБОЙ СТРОИТ в 29 с 10 выполнимых задач: 10 выполнено