Failed to process import candidates for configuration class [cn.zlc.eurekaservice.EurekaServiceAppl
1、问题描述:在一个项目中添加了一个eureka注册中心服务端子模块,eureka模块依赖为在这里插入代码片
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>cn.zlc</groupId><artifactId>micro-service</artifactId><version>0.0.1-SNAPSHOT</version></parent><artifactId>eureka-service</artifactId><version>0.0.1-SNAPSHOT</version><name>eureka-service</name><packaging>jar</packaging><description>eureka 注册中心</description><dependencies><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-netflix-eureka-server</artifactId></dependency></dependencies></project>
2、启动eureka异常,异常信息如下:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [cn.zlc.eurekaservice.EurekaServiceApplication]; nested exception is java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxyat org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:597) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.access$900(ConfigurationClassParser.java:109) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.lambda$processGroupImports$1(ConfigurationClassParser.java:805) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler$$Lambda$212/996125997.accept(Unknown Source) ~[na:na]at java.util.ArrayList.forEach(ArrayList.java:1249) ~[na:1.8.0_20]at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:801) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:771) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:188) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:325) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:242) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at cn.zlc.eurekaservice.EurekaServiceApplication.main(EurekaServiceApplication.java:16) [classes/:na]
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxyat sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724) ~[na:1.8.0_20]at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531) ~[na:1.8.0_20]at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355) ~[na:1.8.0_20]at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286) ~[na:1.8.0_20]at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120) ~[na:1.8.0_20]at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72) ~[na:1.8.0_20]at java.lang.Class.createAnnotationData(Class.java:3508) ~[na:1.8.0_20]at java.lang.Class.annotationData(Class.java:3497) ~[na:1.8.0_20]at java.lang.Class.getDeclaredAnnotations(Class.java:3464) ~[na:1.8.0_20]at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:461) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.addMetaAnnotationsToQueue(AnnotationTypeMappings.java:85) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.addAllMappings(AnnotationTypeMappings.java:79) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:68) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.<init>(AnnotationTypeMappings.java:46) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings$Cache.createMappings(AnnotationTypeMappings.java:253) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings$Cache$$Lambda$9/2107447833.apply(Unknown Source) ~[na:na]at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324) ~[na:1.8.0_20]at org.springframework.core.annotation.AnnotationTypeMappings$Cache.get(AnnotationTypeMappings.java:249) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:206) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:188) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.AnnotationTypeMappings.forAnnotationType(AnnotationTypeMappings.java:175) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.TypeMappedAnnotation.of(TypeMappedAnnotation.java:636) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.annotation.MergedAnnotation.of(MergedAnnotation.java:596) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.type.classreading.MergedAnnotationReadingVisitor.visitEnd(MergedAnnotationReadingVisitor.java:96) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.asm.ClassReader.readElementValues(ClassReader.java:2775) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.asm.ClassReader.accept(ClassReader.java:572) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.asm.ClassReader.accept(ClassReader.java:400) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.createMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:86) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.boot.type.classreading.ConcurrentReferenceCachingMetadataReaderFactory.getMetadataReader(ConcurrentReferenceCachingMetadataReaderFactory.java:73) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:81) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:686) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getMemberClasses(ConfigurationClassParser.java:977) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:347) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:266) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:587) ~[spring-context-5.2.2.RELEASE.jar:5.2.2.RELEASE]... 20 common frames omitted
3、解决
添加eureka服务依赖错误,eureka-service作为整个项目的子模块应该该为如下依赖
<!--eureka 注册中心--><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency>
4、如果eureka模块为一个单独模块,不依赖项目的根pom可以使用spring-cloud-netflix-eureka-server
Failed to process import candidates for configuration class [cn.zlc.eurekaservice.EurekaServiceAppl相关推荐
- SpringBoot微服务项目报错:Failed to process import candidates for configuration class [springfox.boot...
具体错误: [main] ERROR org.springframework.boot.SpringApplication - Application run failed org.springfra ...
- Failed to process import candidates for configuration class [com.wjm.springcloud.Application]; neste
Failed to process import candidates for configuration class [com.wjm.springcloud.Application]; neste ...
- Failed to bind properties under mybatis-plus.configuration.result-maps[0]
Failed to bind properties under 'mybatis-plus.configuration.incomplete-result-maps[0].assistant.conf ...
- 【es-未解决】es 报错 failed to process cluster event (put-mapping) within 30s
文章目录 1.概述 1.概述 出现的原因忘记了,没有去解决,先记录一下 org.elasticsearch.cluster.metadata.ProcessClusterEventTimeoutExc ...
- Failed to process package ‘cartographer_ros‘ :
目录 遇到这个问题分为两种情况 第一种 第二种 cartographer安装成功后可以通过下面代码测试 下载cartographer 例子数据包 如果你想再次打开相应的2D或者3D模型 遇到了两三天的 ...
- SVN报错Cleanup问题解决:Cleanup failed to process the following paths:Can‘t revert
工作的时候遇到SNV 的clean up 失败问题,尝试了很多方法,最后找到了有用的方法做个总结. (文章中有些文件路径涉及公司,所以隐藏了,大概知道是文件路径就可以了) 如果clean up 出现什 ...
- Rollup failed to resolve import “element-plus/es/components“ from “node_modules/element-plus/es/inde
–> Rollup failed to resolve import "element-plus/es/components" from "node_modules ...
- 【SVN】Clean failed to process the following paths:
问题描述 TortoiseSVNCleanup failed to process the following paths:"Directory Path" 浠ュ墠鐨勬搷浣滄病鏈夊 ...
- 【 Failed to process string with tex because latex could not be found /FileNotFoundError: [Errno 2] 】
mac环境下,Python运行时,使用matplotlib.plt 时发生错误 由于Python代码中含有 **plt.rc('text',usetex=True);**导致报错 解决方法:pip/p ...
最新文章
- linux进程间通信:POSIX 消息队列
- 软考-信息系统项目管理师-信息系统项目管理基础
- 如何发挥ERP系统中的财务监控职能?
- Windows API CreateWaitableTimer和SetWaitableTimer
- MacOS 的软件包管理工具 HomeBrew 详解
- source 1.5 中不支持 diamond 运算符
- php jquery ajax实例,jQuery的$.ajax示例
- 非零段划分(CSP202109-2)
- iOS None of the valid provision profiles allowed the specified entitlements:beta-reports-active,asp-
- Vulkan开发环境配置 Win10+VS2019
- UCOS操作系统——任务的挂起与恢复(四)
- TUIO+激光投影互动
- 计算机使用计数制是,进位计数制
- 日语学习的一些网站推荐
- 全志A64触摸屏驱动调试
- Liquibase中利用changelog增加表字段
- 数据结构与算法精选面试50题(附答案)
- 游戏设计的作品集到底该怎么做?
- 华为海思 hikey970 烧录固件 ubuntu桌面版
- 维刻官方正品防伪系统升级公告