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

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整合
2013年7月05日 10:51

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

0 0

采纳的答案

解压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
0 0

先看你加载的classpath,然后再看里面的jar包有没相应的class,可能是你的jar包版本不一致

2013年7月05日 16:46
0 0

刚搭建的框架吧? 
如果读不到任何一个配置文件,就会抛出这个异常。

2013年7月05日 15:36
0 0

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

2013年7月05日 13:45
    • 0
      点赞
    • 0
      收藏
      觉得还不错? 一键收藏
    • 0
      评论
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值