Spring Boot:从1.2.7切换到1.3.0,现在无法启动项目

时间:2015-11-17 14:37:16

标签: java spring gradle spring-boot

我有这样的结构的多部分项目:

main-project-name(build.gradle)
   |
   |-sub-project-1(build-1.gradle)
   |
   |-sub-project-2(build-2.gradle)
   |
   |-web-api-project(build-web.gradle springBootVersion = '1.3.0.RELEASE')

Web API项目以Spring Boot 1.2.7开始,但切换到Spring Boot 1.3.0项目后无法启动。 build-web.gradle包含sub-project-1 and 2

的依赖项

build.gradle包含spring dependencies版本4.2.3

执行:bootRun结果时:

: Application startup failed

java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration due to internal class not found. This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:53) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:102) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:436) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:127) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:116) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:333) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.suostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:677) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:519) ~[spring-context-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118) ~[spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:295) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1112) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1101) [spring-boot-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at tv.project.web.api.Application.main(Application.java:15) [main/:na]


    Caused by: java.lang.NoClassDefFoundError: org/springframework/security/web/util/matcher/RequestMatcher
    at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_45]
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_45]
    at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_45]
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:609) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:521) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.util.ReflectionUtils.doWithMethods(RonUtils.java:507) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:567) ~[spring-core-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:683) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:627) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:597) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1445) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:975) ~[spring-beans-4.2.3.RELEASE.jar:4.2.3.RELEASE]
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:289) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.addBeanType(BeanTypeRegistry.java:278) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry$OptimizedBeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:259) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:182) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:171) ~[spring-boot-autoconfigur.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:139) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:113) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-1.3.0.RELEASE.jar:1.3.0.RELEASE]
    ... 17 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.security.web.util.matcher.RequestMatcher
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_45]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_45]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[na:1.8.0_45]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_45]
    ... 37 common frames omitted

build.gradle中定义的一些依赖项版本:

springVersion = '4.2.3.RELEASE'
springSecurityVersion = '4.0.3.RELEASE'
springDataVersion = '1.8.0.RELEASE'
springDataJpaVersion = '1.9.0.RELEASE'
springDataRedisVersion = '1.6.0.RELEASE'
springIntegrationVersion = '4.2.1.RELEASE'
springRabbitVersion = '1.5.1.RELEASE'
hibernateVersion = '5.0.3.Final'
c3p0Version = '0.9.5.1'
apacheCommonsCSVVersion = '1.2'
awsSDKVersion = '1.10.+'
slf4jVersion = '1.7.12'
jacksonVersion = '2.6.3'
commonsIOVersion = '2.4'
commonsLangVersion = '3.4'
mongoDriverVersion = '2.13.3'
jedisDriverVersion = '2.7.3'

0 个答案:

没有答案