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 [or[email protected]18f8cd79] to prepare test instance [[email protected]]

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无法识别下划线,把下划线换成减号就可以了

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

时间: 2024-08-02 16:43:45

java.lang.IllegalStateException: Service id not legal hostname (leyou_item_service)的相关文章

zbb20180716 SpringBoot 使用feign时报错Service id not legal hostname

SpringBoot 使用feign时报错Service id not legal hostname SpringBoot 使用feign时报错Service id not legal hostname(xx_sss) 原因是feign不支持下划线"_",支持"-",改成xx-sss即可 参考:https://github.com/spring-cloud/spring-cloud-netflix/issues/1582 原文地址:https://www.cnblo

Tomcat上java.lang.IllegalStateException: Optional int parameter 'id' is not present

今日, 本人在tomcat+spring mvc平台的服务器上遇到java.lang.IllegalStateException: Optional int parameter 'id' is not present异常, 很是怪异, mvc方法里面的id为int型, 明明是有值的, 为什么说没有? 改为Integer也不行, mvc方法直接无响应! 然后, 在本地模拟改用例, 发现可以正常执行, 而另一个同事说要把超长的图片参数放到Mvc方法的最后就可以正常访问! 怪异! 后来经过多次试验,

java.lang.IllegalStateException: Failed to check the status of the service

java.lang.IllegalStateException: Failed to check the status of the service com.pinyougou.sellergoods.service.BrandService. No provider available for the service com.pinyougou.sellergoods.service.BrandService from the url zookeeper://192.168.25.129:21

java.lang.IllegalStateException: No instances www.xxxx.com available for localhost

在SpringCloud的项目中,我们使用了自动配置的OAuth2RestTemplate,RestTemplate,但是在使用这些restTemplate的时候,url必须是服务的名称,如果要调用真实的域名或者ip的url,会有错误,如下: URI uri = UriComponentsBuilder.fromUriString("http://www.baidu.com") .build() .toUri(); Object data = restTemplate.getForOb

java.lang.IllegalStateException

java.lang.IllegalStateExceptionorg.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:423)经过分析.查看jdk文档终于找到解决的办法,在response.sendRedirect()方法后加return语句即可,如下:response.sendRedirect(login.jsp);return null;原因是:在程序中两次调用了response.sendRe

java.lang.IllegalStateException: Must have the StrutsPrepareFilter execute before this one

Servlet.service() for servlet [jsp] in context with path [/struts2Study] threw exceptionjava.lang.IllegalStateException: Must have the StrutsPrepareFilter execute before this one at org.apache.struts2.dispatcher.ng.InitOperations.findDispatcherOnThre

批量下载的实现及java.lang.IllegalStateException异常

在工作流的一张表单里可能会有多个步骤上传附件,在用户的待办中往往会存在多条带有附件的任务,如果一一打开并且点击下载链接下载,不仅费时,而且繁琐,用户体验较差. OA系统采用的是FastDFS做为文件服务器,FastDFS的Java客户端提供了上传.下载等功能供调用. 在我之前的文章里对此有描述,目前已有的代码有对文件的批量上传功能,但下载的参数往往是针对单个文件.比如单个文件的下载方法如下: /**  * 文件下载  * @author chao.gao  * @date 2014-2-17 下

java.lang.IllegalStateException: Expected a string but was BEGIN_ARRAY at line 1 column 296

先贴代码 public class ListDataRequest extends JsonRequest<ArrayList<Note>> { public ListDataRequest(int method, String url,Map<String,String> contentBody, Listener<ArrayList<Note>> listener, ErrorListener errorlistener) {  super(

lob类型数据处理 java.lang.IllegalStateException: No LobHandler found for configuration

1 .MySQL处理数据库中lob类型数据,如longblob类型: 2.实体类定义: private byte[] clientFile; 3.映射文件定义: <property name="clientFile" type="org.springframework.orm.hibernate3.support.BlobByteArrayType">      <column name="client_file"/> &