HttpMessageNotReadableException

HttpMessageNotReadableException

情况描述:

spring boot web项目,尝试使用热部署工具。

Controller只写了用来测试异常的方法, 异常处理器去捕获异常。

控制器入参使用了参数校验。

当使用快捷键 Ctrl + Shift + F9 或者 Ctrl + F9 重新编译项目,Spring boot重新加载后 控制台打印:

No active profile set, falling back to default profiles: default

未设置活动配置文件,返回默认配置文件:默认

访问控制器页面报错:

HttpMessageNotReadableException : Http消息不可读异常

也就是此时HttpMessageNotReadableException 的异常处理器失效。

手动重启服务器后,异常处理器可以正常工作。

目前还不知道怎么处理。

猜你喜欢

转载自www.cnblogs.com/songyanrumo/p/12373712.html