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

 . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/ :: 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

相關文章
相關標籤/搜索