llegalstateexception自动配置

bmp9r5qi  于 2021-07-23  发布在  Java
关注(0)|答案(1)|浏览(417)

我正在尝试通过spring启动应用程序转换为spring原生使用原生图像maven插件。我在这里设置了graalvm和原生映像https://docs.spring.io/spring-native/docs/0.9.x/reference/htmlsingle/
本土形象 Package 成功。但是应用程序无法从erorr开始

java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.sleuth.autoconfig.brave.BraveAutoConfiguration
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[na:na]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:489) ~[na:na]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:478) ~[na:na]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140) ~[na:na]
    at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:129) ~[na:na]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:342) ~[com.xxx.yyy.application:5.3.4]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:246) ~[com.xxx.yyy.application:5.3.4]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[na:na]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[na:na]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:745) ~[na:na]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:563) ~[na:na]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[na:na]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[com.xxx.yyy.application:2.4.3]
    at com.xxx.yyy.application.main(Application.java:23) ~[com.xxx.yyy.application:1.5-SNAPSHOT]
Caused by: java.lang.IllegalStateException: java.io.FileNotFoundException: class path resource [org/springframework/cloud/sleuth/autoconfig/brave/AnyTracerModePropertySetCondition$OnConcreteTracerMode.class] cannot be opened because it does not exist
    at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.getMetadata(AbstractNestedCondition.java:149) ~[na:na]
    at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.getMemberConditions(AbstractNestedCondition.java:121) ~[na:na]
    at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.<init>(AbstractNestedCondition.java:114) ~[na:na]
    at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition.getMatchOutcome(AbstractNestedCondition.java:62) ~[com.xxx.yyy.application:2.4.3]
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[com.xxx.yyy.application:2.4.3]
    ... 19 common frames omitted
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/cloud/sleuth/autoconfig/brave/AnyTracerModePropertySetCondition$OnConcreteTracerMode.class] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[na:na]
    at org.springframework.core.type.classreading.SimpleMetadataReader.getClassReader(SimpleMetadataReader.java:55) ~[na:na]
    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:49) ~[na:na]
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[na:na]
    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[na:na]
    at org.springframework.boot.autoconfigure.condition.AbstractNestedCondition$MemberConditions.getMetadata(AbstractNestedCondition.java:146) ~[na:na]
    ... 23 common frames omitted

spring本机版本:0.9.0

<dependency>
  <groupId>org.springframework.experimental</groupId>
  <artifactId>spring-native</artifactId>
  <version>0.9.0</version>
</dependency>

spring boot版本:2.4.3

<parent>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-parent</artifactId>
  <version>2.4.3</version>
  <relativePath/>
 </parent>

Spring Cloud版本:2020.0.1

<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-dependencies</artifactId>
   <version>2020.0.1</version>
   <type>pom</type>
   <scope>import</scope>
 </dependency>
h43kikqp

h43kikqp1#

好吧,我刚发现 sleuth spring本机尚不支持。
spring初始值设定项中的警告消息:

The following was discovered as part of building this project:
The following dependency is not known to work with Spring Native: 'Sleuth'. As a result, your application may not work as expected.

相关问题