SpringCloud Eureka Client启动就停止报错

在尝试启动SpringCloud Eureka Client时遇到了应用启动后立即停止的问题。日志显示应用正常初始化,但之后突然停止,未显示正常的服务注册信息。通过检查发现,问题可能在于缺少了Spring Boot的web依赖。添加`spring-boot-starter-web`依赖到项目pom文件后,重新启动,应用成功运行并完成了服务注册。

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

Spring boot 版本为 2.0.2.RELEASE

Spring Cloud 版本为 Finchley.RC2

启动报错信息如下

2018-06-14 09:09:14.637  INFO 10436 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@48793bef: startup date [Thu Jun 14 09:09:14 CST 2018]; root of context hierarchy
2018-06-14 09:09:14.958  INFO 10436 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-06-14 09:09:15.023  INFO 10436 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$6872207f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.2.RELEASE)


2018-06-14 09:09:15.776  INFO 10436 --- [           main] com.ligq.client.ClientApplication        : No active profile set, falling back to default profiles: default
2018-06-14 09:09:15.792  INFO 10436 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a551a63: startup date [Thu Jun 14 09:09:15 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@48793bef
2018-06-14 09:09:16.199  INFO 10436 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=c0d788a6-3698-3a44-a78c-18f4704863ee
2018-06-14 09:09:16.213  INFO 10436 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-06-14 09:09:16.275  INFO 10436 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.auto

回答:启动Spring Cloud时,您遇到了以下错误信息: "Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityConfig': Unsatisfied dependency expressed through field" 和 "Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: 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)}"。 这些错误通常是由于缺少依赖或配置错误引起的。根据引用中提供的信息,您可以尝试在pom.xml文件中添加以下依赖来解决问题: ```xml <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bootstrap</artifactId> <version>3.0.2</version> </dependency> ``` 添加完依赖后,尝试更新Maven项目以加载新的依赖项。这可能会解决您遇到的错误。如果问题仍然存在,请确保您的配置文件和注解正确,并且所有必需的依赖项都已正确添加。还可以检查您的代码中是否有任何冲突或错误。 希望这些信息对您有帮助,如果您还有其他问题,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [【已解决】spring cloud配置中心config-client无法启动(No spring.config.import property has been ...](https://blog.csdn.net/m0_53614153/article/details/124201942)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [springcloud项目启动报错处理](https://blog.csdn.net/qq_41358151/article/details/130721001)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值