1. 问题定位
昨天发现日志里有报空指针的异常,定位到代码位置如下:
1 | public void xxxTest(Type type) { |
DemoBaseService相关代码如下:
昨天发现日志里有报空指针的异常,定位到代码位置如下:
1 | public void xxxTest(Type type) { |
DemoBaseService相关代码如下:
A项目远程调用另一项目时是用http方式进行请求的,使用的工具是FeignClient, 以下是FeignClient的踩坑日记
1.在服务的启动入口,即main方法所在的类上需要加一个EnableFeignClients注解,并且如果需要扫描的包不在该类所属的同一包下,需要加上basePackages,否则可能会生成一个代理对象,并且报错
1 | Invalid bound statement (not found): xxx.common.xx.xx.xxXClient.getXxxList |
解决方法如下:
1 | @EnableFeignClients(basePackages = {"test.common"}) |
在Spring Boot项目中,常常会遇到实体类的某个字段是枚举类,但是数据库/前端 使用的是枚举类的code,所以会涉及到Json 序列化与反序列化的需求,这里以一个例子来记录如何正确地使用Json注解。
项目中使用的Json工具是Jackson,以该工具为例
1 | public class Transaction { |
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
1 | $ hexo new "My New Post" |
More info: Writing
1 | $ hexo server |
More info: Server
1 | $ hexo generate |
More info: Generating
1 | $ hexo deploy |
More info: Deployment