Spring Boot定义的REST接口使用CSE框架后报告404

定义了如下接口:

1

2

3

4

5

  @GetMapping(path = "/v1/user111/ping", produces = MediaType.APPLICATION_JSON_VALUE)

  String ping111()

  {

    return null;

  }

在Spring Boot下能够正常调用,切换CSE框架后,报告如下错误:

o.a.s.c.rest.locator.OperationLocator    : locate path failed, status:Not Found, http method:GET, path:/v1/user111/ping/, microserviceName:user-service

出现这个原因是因为这个接口不是public的, CSE约束所有发布为接口的方法,必须是public,而spring boot则没这个限制。

猜你喜欢

转载自blog.csdn.net/looook/article/details/88622354