在配置一個springmvc+mybatis的項目時,總是有報一個錯誤:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0'
defined in class path resource [mybatis.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/ibatis/session/SqlSession
確信在pom文件中添加了mybatis的引用,最后去本地maven庫和項目依賴包中查找看,並沒有該jar的引用。原因是intellij idea並沒有下載該jar包,重新導入引用即可解決。