在Java 10中运行我的Spring引导项目并Maven运行一切正常。只需将JDK从10更改为11就会引入以下错误
emailer_1 | java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration.reactiveVaultSessionManager
emailer_1 | at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64)
emailer_1 | at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
emailer_1 | at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:181)
emailer_1 | at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:141)
emailer_1 | at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117)
emailer_1 | at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327)
emailer_1 | at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232)
emailer_1 | at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
| Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.vault.config.VaultReactiveBootstrapConfiguration] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@5d099f62]
emailer_1 | at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:680)
emailer_1 | at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:577)
emailer_1 | at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:562)
emailer_1 | at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:620)
emailer_1 | at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
emailer_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:721)
emailer_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:662)
emailer_1 | at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:630)
emailer_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1491)
emailer_1 | at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1014)
emailer_1 | at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:198)
emailer_1 | at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:174)
emailer_1 | at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:167)
emailer_1 | at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.lambda$updateTypesIfNecessary$3(BeanTypeRegistry.java:154)
emailer_1 | at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
emailer_1 | at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:152)
emailer_1 | at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:118)
emailer_1 | at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:301)
emailer_1 | at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:290)
emailer_1 | at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:232)
emailer_1 | at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:152)
emailer_1 | at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
emailer_1 | ... 36 common frames omitted
emailer_1 | Caused by: java.lang.ClassNotFoundException: reactor.core.publisher.Mono
emailer_1 | at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
emailer_1 | at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
emailer_1 | at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:93)
emailer_1 | at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
emailer_1 | ... 61 common frames omitted
我没有使用Spring Webflux框架,并且以前不需要任何带有jar的反应堆框架。我知道Java 11从JDK中淘汰了很多JEE内容,但这不是那样。
我尝试了SpringBoot 2.0.5版本和2.1的最新里程碑版本(M4),结果是相同的。我将Spring Cloud版本从Finchley.SR1更改为Greenwich.M1,结果相同。
还有其他人遇到类似的问题吗?任何帮助将不胜感激。
编辑:仅将反应堆堆芯作为托管依赖项添加到我的Pom中会导致另一个问题,即它找不到Netty库...这很奇怪,因为它应该使用tomcat。
答案 0 :(得分:1)
在撰写本文时,从Spring Boot文档中,Spring Boot 2.1.0.M4和2.0.5.RELEASE需要Java 8或9和Spring Framework 5.1.0.RELEASE或更高版本。因此,我认为Spring Boot尚未正式支持Java 11。