欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

java.lang.IllegalStateException: Service id not legal hostname

程序员文章站 2022-07-15 12:58:48
...

服务名不可匹配,非法的的问题: java.lang.IllegalStateException: Service id not legal hostname (medical_ocr.medical_ocr_app) at org.springframework.util.Assert.state(Assert.java:73) ~[spring-core-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.cloud.openfeign.FeignClientsRegistrar.getName(FeignClientsRegistrar.java:237) ~[spring-cloud-openfeign-core-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.openfeign.FeignClientsRegistrar.registerFeignClient(FeignClientsRegistrar.java:172) ~[spring-cloud-openfeign-core-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.openfeign.FeignClientsRegistrar.registerFeignClients(FeignClientsRegistrar.java:158) ~[spring-cloud-openfeign-core-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.openfeign.FeignClientsRegistrar.registerBeanDefinitions(FeignClientsRegistrar.java:83) ~[spring-cloud-openfeign-core-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.lambda$loadBeanDefinitionsFromRegistrars$1(ConfigurationClassBeanDefinitionReader.java:358) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at java.util.LinkedHashMap.forEach(LinkedHashMap.java:676) ~[?:1.8.0_73]

使用微服务spring cloud中的@FeignClient,定义的名称不能带下划线"_",属于非字符
复制代码