码迷,mamicode.com
首页 > 编程语言 > 详细

java.lang.IllegalStateException: Service id not legal hostname (leyou_item_service)

时间:2019-11-21 10:23:03      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:Servle   context   cat   file   ring   tco   web   listen   stc   


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

2019-11-20 23:41:02.630  INFO 93652 --- [           main] com.rao.leyou.search.SearchTest          : No active profile set, falling back to default profiles: default
2019-11-20 23:41:03.121 ERROR 93652 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Service id not legal hostname (item_service)
    2019-11-20 23:41:03.126 ERROR 93652 --- [           main] o.s.test.context.TestContextManager      : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@18f8cd79] to prepare test instance [com.rao.leyou.search.SearchTest@49798e84]

java.lang.IllegalStateException: Failed to load ApplicationContext
   
Caused by: java.lang.IllegalStateException: Service id not legal hostname (item_service)
    


Process finished with exit code -1

 在为微服务取名时,千万别用下划线,springcloud无法识别下划线,把下划线换成减号就可以了

java.lang.IllegalStateException: Service id not legal hostname (leyou_item_service)

标签:Servle   context   cat   file   ring   tco   web   listen   stc   

原文地址:https://www.cnblogs.com/rao11/p/11902059.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!