相同类型的对象不能互相转换:java.lang.ClassCastException: com.anhoo.po.UserPo cannot be cast to com.anhoo.po.UserPo

@PostMapping("/findone")
    public String getone(UserVo userVo) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        if (userVo != null) {
            UserPo userPo = (UserPo) ConvertUtil.convertDtoAndVo(userVo, UserPo.class);
            return ResultUtil.okRes(dataUserService.findOne(userPo));
        } else {
            return ResultUtil.execRes();
        }
    }

这个时候,需要看一下你的pom里面是否有devtools这个包

如果有的话在resources下新建文件夹 META-INF新建文件内容:

restart.include.mapper=/mapper-[\\w-\\.]+jar
restart.include.pagehelper=/pagehelper-[\\w-\\.]+jar

 

posted @ 2017-08-22 11:01  大园子  阅读(809)  评论(0编辑  收藏  举报