java.lang.ClassCastException: com.hahah.atcrowdfunding.bean.User cannot be cast to com.hahah.atcrowdfunding.bean.Role

result写错了,应该是resultType,但是复制粘贴之前写的(resultMap),没有把result改掉,改成resultType
以后一定要牢记,更改result
本文详细解析了在Java中遇到的ClassCastException异常,具体为User类无法转换为Role类的问题。作者分享了错误的原因在于使用了错误的配置参数,原本应该是resultType却误用为resultMap,提醒开发者在修改配置时要仔细检查参数名称。
java.lang.ClassCastException: com.hahah.atcrowdfunding.bean.User cannot be cast to com.hahah.atcrowdfunding.bean.Role

result写错了,应该是resultType,但是复制粘贴之前写的(resultMap),没有把result改掉,改成resultType
以后一定要牢记,更改result
5万+
1万+
481
1318
2802
4836