1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > java.lang.ClassCastException: com.xx.User cannot be cast to com.xx.User

java.lang.ClassCastException: com.xx.User cannot be cast to com.xx.User

时间:2020-09-13 02:42:06

相关推荐

java.lang.ClassCastException: com.xx.User cannot be cast to com.xx.User

项目使用spring boot1.5.2 集成mybatis通用mapper插件,发现查询方法selectByPrimaryKey

会导致发生异常—— java.lang.ClassCastException:com.xxx.xxx.entity cannot be cast to com.xxx.xxx.entity

测试过:insert、update、delete方法都没有问题,就是查询出实体就报异常。后来到github看到这是插件的一个bug

解决方法如下:

在spring boot项目resources目录下创建一个META-INF文件夹,在META-INF目录下再创建一个

spring-devtools.properties 文件

加入以下代码即可解决

panycommonlibs=tk/mybatis.*

原文链接地址:/jie873440996/article/details/70231260

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。