错误:Bean property 'sessionFactory' is not writable or has an invalid setter method.
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [com.xk.dao.impl.ImplDepartmentDao]: Bean property 'sessionFactory' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1060)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:918)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:82)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:62)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1489)
... 22 more
原因:在配置文件中dao注入的时候,如果写了<property></property>属性,就必须写sessionFactory的setter和getter方法;
解决办法:①删掉<property></property>属性
②添加setter和getter方法

更改之后如下图:

错误:Bean property 'sessionFactory' is not writable or has an invalid setter method.的更多相关文章
- org.springframework.beans.NotWritablePropertyException:Bean property 'xxxService' is not writable or has an invalid setter method.
完整报错提示信息:Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'blogDe ...
- Bean property ‘mapperHelper’ is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
spring boot 报错: Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property ...
- Bean property '**DAO' is not writable or has an invalid setter method
ApplicationContext.xml中配置有问题,里面的bean的属性名称写错了. ApplicationContext.xml中写的是loginDAO,在java类里配置的bean却写成了l ...
- error: Bean property 'userDAO' is not writable or has an invalid setter method.
使用Spring属性注入的方式,没有在ServiceImpl中setDao,导致程序报错 public class AddressServiceImpl implements IAddressServ ...
- Bean property 'transactionManagerBeanName' is not writable or has an invalid set
[2017-02-07 11:38:48,458]-[localhost-startStop-1]-[org.springframework.beans.factory.support.Default ...
- Spring整合Hibernate报错:annotatedClasses is not writable or has an invalid setter method
Spring 整合Hibernate时报错: org.springframework.beans.factory.BeanCreationException: Error creating bean ...
- dubbo-admin-2.5.3 运行报错: Bean property 'URIType' is not writable or has an invalid 解决方法
因为 jdk 是1.8的版本,和 dubbo-admin 存在兼容性问题.所以报错: Bean property 'URIType' is not writable or has an invalid ...
- is not writable or has an invalid setter method错误的解决
java中在配置spring时,遇到is not writable or has an invalid setter method的错误一般是命名方式的问题 需要写成private userInfoD ...
- Bean property XX' is not writable or has an invalid setter method
刚刚搞spring.property注入时遇到这个问题,百度一下.非常多人说是命名或者get set方法不一致的问题,可是这个我是知道的.写的时候也注意到这些.所以应该不是这个问题.以为是xml头写的 ...
随机推荐
- appium环境搭建-运行
appium是测试移动端的测试工具 首先要下载手机模拟器,或者连接真机.我用的夜神模拟器.安装打开它.安装这个有很高的兼容性要求,我也是小白,摸索了三天才弄出来 一.原理如图: 二.需要安装的软件: ...
- 把vim插入状态的光标改为竖线
和终端有关系,如果是Konsole的终端,把下面两行加到.vimrc文件里就可以 let &t_SI = "\<Esc>]50;CursorShape=1\x7" ...
- 【Checkio Exercise】Three Point Circle
计算三角形外接圆的函数: Three Point Circle If we want to build new silos, then we need to make more formal and ...
- html5 javascript 事件练习3键盘控制练习
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8&qu ...
- qt creator中编辑Makefile的设置
在qt creator中编辑Makefile时的Tab键总是不能识别,需要这样设置
- jQuery图片无缝轮播
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- Docker Registry V2 Garbage Collection
运行 docker run --rm -v /nfs1/docker/registry:/var/lib/registry registry:2.5.1 garbage-collect -d /roo ...
- 爬虫----selenium模块
一.介绍 selenium最初是一个测试工具,而爬虫中使用它主要是为了解决requests无法直接执行JavaScript代码的问题 selenium本质是通过驱动浏览器,完全模拟浏览器的操作,比如跳 ...
- Python 面向对象介绍
面向对象,面向过程 面向对象引子 人狗大战,人与狗都有不同的特点,如果要写出这两个不同角色 需要写出两个角色,可以使用嵌套函数,函数内在写入函数,然后通 过字典,将里层函数reture出来,在调用. ...
- Java this关键字 学习笔记
前言: 这篇博文就是系统的学习一下Java中的this关键字,本人对this关键字的理解知识简单的停留在对 类的成员变量进行赋值,这次所以决定系统的体会一下this 关键字 转自:https://b ...