减肥业
2015-07-20 07:06springmvc+mybatis整合 MapperScannerConfigurer配置出错
1配置如下:
问题:如果配置了 <property name="sqlSessionFactoryBeanName" value="wechatSqlSessionFactory" />,启动的时候报错如下:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.mybatis.spring.mapper.MapperScannerConfigurer#0' defined in class path resource [spring/applicationContext-persistence.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'sqlSessionFactoryBeanName' of bean class [org.mybatis.spring.mapper.MapperScannerConfigurer]: Bean property 'sqlSessionFactoryBeanName' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
如果不配置sqlSessionFactoryBeanName,则可以正常启动,正常操作数据库。
求大神解释一下到底是什么问题,怎么解决这种问题。希望能得到帮助。谢谢
- 点赞
- 回答
- 收藏
- 复制链接分享
3条回答
为你推荐
- MavenWeb项目使用mybatis的分页查询插件,在项目部署时出现错误
- java
- github
- spring
- maven
- tomcat
- 2个回答
- springMVC+Spring+Mybatis整合出错
- mybatis
- spring
- 10个回答
- [新手求助]spring整合mybatis时自动扫描错误
- 9个回答