启动Eureka时报错

本文详细解析了启动Eureka服务时遇到的错误,指出问题源于Spring Cloud和Spring Boot版本不一致。提供了修复步骤,包括更新版本依赖,并强调了确保两者版本匹配的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

启动Eureka时报错:Error creating bean with name ‘traceFilterRegistration’ defined in class path resource

#报错全文

Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name ‘traceFilterRegistration’ defined in class path resource [org/springframework/cloud/netflix/eureka/server/EurekaServerAutoConfiguration.class]: Unsatisfied dependency expressed through method ‘traceFilterRegistration’ parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘javax.servlet.Filter’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=httpTraceFilter)}

原因分析

springcloud和spring boot版本不匹配

解决方案

登录官网:https://spring.io/projects/spring-cloud
在这里插入图片描述找到使用的版本并匹配相对应的版本到pom文件中

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Hoxton.SR8</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>2.3.3.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

将spring cloud与spring boot版本相匹配

若还是启动报错,检查eureka-server依赖

org.springframework.cloud
spring-cloud-starter-eureka-server
1.4.7.RELEASE

应该就可以解决了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值