配置如下:
问题:如果配置了 <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,则可以正常启动,正常操作数据库。
求大神解释一下到底是什么问题,怎么解决这种问题。希望能得到帮助。谢谢
Does the parameter type of the setter match the return type of the getter? 这说明你配置的bean 里面的参数(parameter)没有get方法,再检查一下你的配置吧
Does the parameter type of the setter match the return type of the getter? 这说明你配置的bean 里面的参数(parameter)没有get方法,再检查一下你的配置吧
Mapper文件有问题
http://blog.csdn.net/evankaka/article/details/45790533