报错信息:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.music.entity.Information' with value '1507607618402938881' Cause: java.lang.IllegalArgumentException: argument type mismatch] with root cause
java.lang.IllegalArgumentException: argument type mismatch
问题原因:
在数据库中创建表的时候,忘记将主键id设置为自增,没有检查数据库,然后就在Idea里面自动生成代码了。(大家开发的时候,建议确保表无误再写代码,不然后期再改表有点烦)
解决办法:
在private Integer id; 上加@TableId(value = "id",type = IdType.AUTO),id是我表的主键,按照自己的表进行对应的修改即可。
修改前
修改后
后端新人,欢迎大家斧正!
最后
以上就是淡然小伙最近收集整理的关于从swagger接收数据,Idea后台报错java.lang.IllegalArgumentException: argument type mismatch的全部内容,更多相关从swagger接收数据,Idea后台报错java.lang.IllegalArgumentException:内容请搜索靠谱客的其他文章。
发表评论 取消回复