【錯誤解決】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


通過MapperScannerConfigurer進行mapper掃描


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM