减肥业 2015-07-20 07:06 采纳率: 0%
浏览 6513
已结题

springmvc+mybatis整合 MapperScannerConfigurer配置出错

配置如下:




问题:如果配置了    <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条回答 默认 最新

  • fxss1129 2015-07-20 07:08
    关注

    Does the parameter type of the setter match the return type of the getter? 这说明你配置的bean 里面的参数(parameter)没有get方法,再检查一下你的配置吧

    评论

报告相同问题?

悬赏问题

  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果