SpringCloud客户端Client启动时自动停止

本文记录了一次Spring Boot应用启动时遇到的问题及解决方案。启动过程中出现警告信息提示未找到spring.application.name配置,并默认使用application作为服务名。最终通过在pom.xml文件中引入spring-boot-starter-web依赖成功解决了该问题。

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

报错:
2018-05-30 18:07:35.436 INFO 7912 — [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@20ce78ec: startup date [Wed May 30 18:07:35 CST 2018]; root of context hierarchy
2018-05-30 18:07:35.652 INFO 7912 — [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 ‘javax.inject.Inject’ annotation found and supported for autowiring
2018-05-30 18:07:35.699 INFO 7912 — [ main] trationDelegate$BeanPostProcessorChecker : Bean ‘configurationPropertiesRebinderAutoConfiguration’ of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration
EnhancerBySpringCGLIB
a1cf77d7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

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

2018-05-30 18:07:36.603 INFO 7912 — [ main] com.zsl.client.ClientApplication : No active profile set, falling back to default profiles: default
2018-05-30 18:07:36.616 INFO 7912 — [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@198d6542: startup date [Wed May 30 18:07:36 CST 2018]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@20ce78ec
2018-05-30 18:07:36.977 INFO 7912 — [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=c0d788a6-3698-3a44-a78c-18f4704863ee

2018-05-30 18:07:37.155 WARN 7912 — [ main] o.s.c.n.a.ArchaiusAutoConfiguration : No spring.application.name found, defaulting to ‘application’
2018-05-30 18:07:37.157 WARN 7912 — [ main] c.n.c.sources.URLConfigurationSource : No URLs will be polled as dynamic configuration sources.
2018-05-30 18:07:39.932 INFO 7912 — [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : DiscoveryClient_UNKNOWN/OnePiece: registering service…
2018-05-30 18:07:39.948 INFO 7912 — [ main] com.zsl.client.ClientApplication : Started ClientApplication in 6.129 seconds (JVM running for 7.74)
2018-05-30 18:07:39.952 INFO 7912 — [ Thread-18] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@198d6542: startup date [Wed May 30 18:07:36 CST 2018]; parent:

Process finished with exit code 0

解决方法:
pom.xml中加入

<dependency>  
   <groupId>org.springframework.boot</groupId>  
   <artifactId>spring-boot-starter-web</artifactId>  
</dependency>  

即可

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值