首页 > 移动平台 > 详细

【错误解决】BeanDefinitionStoreException: Failed to read candidate component class: file [mapper.class文件]; nested exception is java.lang.IllegalArgumentException

时间:2018-10-28 18:43:33      阅读:164      评论:0      收藏:0      [点我收藏+]

问题描述:

  “spring-mybatis整合,使用mapper代理开发,通过MapperScannerConfigurer进行mapper扫描”的练习中,出现异常:

  org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\项目\mybatis_spring\bin\cn\itheima\ssm\mapper\UserMapper.class]; nested exception is java.lang.IllegalArgumentException

问题分析:

  我使用的spring是3.2版本的,而编译器是jdk1.8,根据spring官网的说法,要使用java8,只支持spring 4.X以上版本,而spring的使用最低java要求java5及以上,也就是说spring与编译器版本不匹配

问题解决:

  将项目使用的编译器改为1.7版本:

  选中项目右键->properties

技术分享图片


通过MapperScannerConfigurer进行mapper扫描

【错误解决】BeanDefinitionStoreException: Failed to read candidate component class: file [mapper.class文件]; nested exception is java.lang.IllegalArgumentException

原文:https://www.cnblogs.com/gongren/p/9866246.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!