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

问题描述:

  “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

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


通过MapperScannerConfigurer进行mapper扫描

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

上一篇:Spring boot读取application.properties中文乱码


下一篇:【BZOJ】2730: [HNOI2012]矿场搭建【Tarjan找割点】【分联通块割点个数】