升级spring-cloud-gateway到4.1.0的过程中遇到的问题的以及对应解决方案
· 2 min read
此文记录了升级spring-cloud-gateway到4.1.0的过程中遇到的问题以及对应的解决方案.
此文记录了升级spring-cloud-gateway到4.1.0的过程中遇到的问题以及对应的解决方案.
升级内部框架版本后,发现Feign调用失败,报错如下:
Failed to convert value of type 'java.lang.String' to required type 'java.time.ZonedDateTime';
nested exception is org.springframework.core.convert.ConversionFailedException:
Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam @org.springframework.format.annotation.DateTimeFormat java.time.ZonedDateTime] for value '2023/12/18 02:57';
nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [2023/12/18 02:57]
客户端伪代码如下:
public interface FeignClient {
@GetMapping("/")
List<PlatformStandardOrderDto> test(
@RequestParam ZonedDateTime startTime,
@RequestParam ZonedDateTime endTime
);
}
这个问题的现象是Feign调用时参数中的ZonedDatetime
类型的时间格式化的结果服务端无法解析