Unable to read meta-data for class org.springframework.boot.autoconfigure.cloud.CloudAutoConfigurati

在执行jar包的时候,SpringBoot提示

java.lang.IllegalStateException: Unable to read meta-data for class org.springframework.boot.autoconfigure.cloud.CloudAutoConfiguration
        at org.springframework.boot.autoconfigure.AutoConfigurationSorter$AutoConfigurationClass.getAnnotationMetadata(AutoConfigurationSorter.java:245) ~[IM.jar:na]
        at org.springframework.boot.autoconfigure.AutoConfigurationSorter$AutoConfigurationClass.getOrder(AutoConfigurationSorter.java:214) ~[IM.jar:na]
        at org.springframework.boot.autoconfigure.AutoConfigurationSorter$AutoConfigurationClass.access$000(AutoConfigurationSorter.java:155) ~[IM.jar:na]
        at org.springframework.boot.autoconfigure.AutoConfigurationSorter.lambda$getInPriorityOrder$0(AutoConfigurationSorter.java:62) ~[IM.jar:na]
        at java.util.TimSort.countRunAndMakeAscending(Unknown Source) ~[na:1.8.0_121]
        at java.util.TimSort.sort(Unknown Source) ~[na:1.8.0_121]
        at java.util.Arrays.sort(Unknown Source) ~[na:1.8.0_121]
        at java.util.ArrayList.sort(Unknown Source) ~[na:1.8.0_121]
        at org.springframework.boot.autoconfigure.AutoConfigurationSorter.getInPriorityOrder(AutoConfigurationSorter.java:61) ~[IM.jar:na]
        at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.sortAutoConfigurations(AutoConfigurationImportSelector.java:461) ~[IM.jar:na]
        at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector$AutoConfigurationGroup.selectImports(AutoConfigurationImportSelector.java:442) ~[IM.jar:na]
        at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:881) ~[IM.jar:na]
        at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:804) ~[IM.jar:na]
        at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:774) ~[IM.jar:na]
        at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:185) ~[IM.jar:na]
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:315) ~[IM.jar:na]
        at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[IM.jar:na]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[IM.jar:na]
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[IM.jar:na]
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691) ~[IM.jar:na]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528) ~[IM.jar:na]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[IM.jar:na]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [IM.jar:na]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [IM.jar:na]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [IM.jar:na]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [IM.jar:na]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [IM.jar:na]
        at start.AppApplication.main(AppApplication.java:21) [IM.jar:na]
Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/cloud/CloudAutoConfiguration.class] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) ~[IM.jar:na]
        at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:51) ~[IM.jar:na]
        at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[IM.jar:na]
        at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:123) ~[IM.jar:na]
        at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[IM.jar:na]
        at org.springframework.boot.autoconfigure.AutoConfigurationSorter$AutoConfigurationClass.getAnnotationMetadata(AutoConfigurationSorter.java:241) ~[IM.jar:na]
        ... 27 common frames omitted

首先检查spring.factories文件中的

org.springframework.boot.autoconfigure.cloud.CloudAutoConfiguration,\

配置是否正确,逗号和反斜杠之间不能有空格。还有就是确认下项目是否需要加载这个配置。如果不需要,可以去掉。如果需要的话,应该就是相应的依赖包没有下载完。

可以参考以下两个解决方法解决:

http://www.hyhblog.cn/2018/08/29/spring-boot-unable-to-read-meta-data-for-class/

https://blog.csdn.net/trisonlu123/article/details/80070596

 

你可能感兴趣的:(Java,springboot)