首页 新闻 会员 周边

在mybatis和spring整合中使用spring的MapperScannerConfigurer 运行出错

0
悬赏园豆:5 [待解决问题]

DEBUG [main] - Initializing new StandardEnvironment
DEBUG [main] - Adding [systemProperties] PropertySource with lowest search precedence
DEBUG [main] - Adding [systemEnvironment] PropertySource with lowest search precedence
DEBUG [main] - Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
DEBUG [main] - Looking for matching resources in directory tree [E:\myworkspace\mybatis_spring3\bin\com\nemo\ssm\mapper]
DEBUG [main] - Searching directory [E:\myworkspace\mybatis_spring3\bin\com\nemo\ssm\mapper] for files matching pattern [E:/myworkspace/mybatis_spring3/bin/com/nemo/ssm/mapper/**/*.class]
DEBUG [main] - Resolved location pattern [classpath*:com/nemo/ssm/mapper/**/*.class] to resources [file [E:\myworkspace\mybatis_spring3\bin\com\nemo\ssm\mapper\UserMapper.class], file [E:\myworkspace\mybatis_spring3\bin\com\nemo\ssm\mapper\UserMapperTest.class]]
 INFO [main] - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@71318ec4: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,sqlSessionFactory,org.mybatis.spring.mapper.MapperScannerConfigurer#0]; root of factory hierarchy

 

注:如果使用MapperFactoryBean的话不报错。用批量扫描MapperScannerConfigurer的话就会报这一错误。实在想不明白。搜了很多也没找到正确的答案。。。各位帮帮忙,究竟哪出错了。

问题补充:

这是我的mapper批量扫描配置:

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionTemplateBeanName" value="sqlSessionFactory"/>
<property name="basePackage" value="com.nemo.ssm.mapper"/>
</bean>

仲秋白露的主页 仲秋白露 | 初学一级 | 园豆:197
提问于:2016-05-19 16:44
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册