您的位置:首页 > 移动开发

Mybatis提示Cannot find class [org.mybatis.spring.mapper.MapperScannerConfigurer]

2017-04-21 15:33 1276 查看


Mybatis提示Cannot find class [org.mybatis.spring.mapper.MapperScannerConfigurer]10

如题:mybatis提示如下异常,是什么原因? 

by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.mybatis.spring.mapper.MapperScannerConfigurer] for bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [applicationContext-mybatis.xml];
nested exception is java.lang.ClassNotFoundException: org.mybatis.spring.mapper.MapperScannerConfigurer 

mybatis相关配置: 

<!-- scan for mappers and let them be autowired --> 

   <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> 

       <property name="basePackage" value="com.hft.dal.mapper" /> 

       <property name="markerInterface" value="com.hft.dal.SqlMapper" /> 

   </bean> 

问题补充:忘记说,这个是mybatis与spring整合

MyBatis 
2013年7月05日 10:51



hft24dq 
10 
0 0 3


添加评论



关注(0)



4个答案按时间排序按投票排序

00


采纳的答案

解压mybatis-spring1.0.0-RC2.jar,看其中是否有org.mybatis.spring.mapper.MapperScannerConfigurer这个类,若没有换个版本,http://www.jarvana.com/jarvana/archive-details/org/mybatis/mybatis-spring/1.0.2/mybatis-spring-1.0.2.jar

2013年7月05日 11:04



zyn010101 
2795 
2 3 156


3条评论

00

先看你加载的classpath,然后再看里面的jar包有没相应的class,可能是你的jar包版本不一致
2013年7月05日 16:46



jjjssh 
320 
0 0 6


1条评论

00

刚搭建的框架吧? 

如果读不到任何一个配置文件,就会抛出这个异常。
2013年7月05日 15:36



sgq0085 
26 
0 1 6


2条评论

00

把引入的包贴出来看看,顺便把错误日志贴上来,内容多点,不然这样只会认为是缺少包。
2013年7月05日 13:45



kjmmlzq19851226 
260 
0 0 18
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐