1、There was a problem with the instance info replicator
- 错误原因: 该服务尝试将自己作为客服端注册
- 解决办法: 在application.yml配置文件中,设置
# 注册Eureka服务
eureka:
client:
# Eureka服务注册中心会将自己作为客户端来尝试注册它自己,必須禁止
register-with-eureka: false
fetch-registry: false
实体类转化出错: disable SerializationFeature.FAIL_ON_EMPTY_BEANS
- 错误原因: 使用的框架是Spring Boot,处理完请求之后,返回数据之前,在POJO转化成JSON时,有些属性违背输出规则或者有些属性循环引用会造成无法输出。
- 解决办法: 在实体类上面加上注解
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
This application has no explicit mapping for /error, so you are seeing this as a fallback.
- 错误原因: 很可能是你Application启动类放的位置不对。要将Application放在最外层,也就是要包含所有子包。
- 解决办法: 将Application放在最外层,也就是要包含所有子包。
message:Request method 'POST' not supported
There was an unexpected error (type=Internal Server Error, status=500). status 405 reading UserFeignClient#getUser(User); content: {"timestamp":"2018-09-07T09:01:14.290+0000","status":405,"error":"Method Not Allowed","message":"Request method 'POST' not supported","path":"/feign-get-user"}
-
错误原因: 该请求不会成功,只要参数是复杂对象,即使指定了是GET方法,feign依然会以POST方法进行发送请求。可能是我没找到相应的注解或使用方法错误。
-
解决办法:
// 该请求不会成功,只要参数是复杂对象,即使指定了是GET方法,feign依然会以POST方法进行发送请求。可能是我没找到相应的注解或使用方法错误。
@RequestMapping(method = RequestMethod.GET, value = "/feign-get-user")
public User getUser(User user);
//正确用法
@RequestMapping(method = RequestMethod.GET, value = "/feign-get-user")
public User getUser(