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.的更多相关文章

  1. 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 ...

  2. 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 ...

  3. Bean property '**DAO' is not writable or has an invalid setter method

    ApplicationContext.xml中配置有问题,里面的bean的属性名称写错了. ApplicationContext.xml中写的是loginDAO,在java类里配置的bean却写成了l ...

  4. error: Bean property 'userDAO' is not writable or has an invalid setter method.

    使用Spring属性注入的方式,没有在ServiceImpl中setDao,导致程序报错 public class AddressServiceImpl implements IAddressServ ...

  5. 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 ...

  6. Spring整合Hibernate报错:annotatedClasses is not writable or has an invalid setter method

    Spring 整合Hibernate时报错: org.springframework.beans.factory.BeanCreationException: Error creating bean ...

  7. 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 ...

  8. is not writable or has an invalid setter method错误的解决

    java中在配置spring时,遇到is not writable or has an invalid setter method的错误一般是命名方式的问题 需要写成private userInfoD ...

  9. Bean property XX&#39; is not writable or has an invalid setter method

    刚刚搞spring.property注入时遇到这个问题,百度一下.非常多人说是命名或者get set方法不一致的问题,可是这个我是知道的.写的时候也注意到这些.所以应该不是这个问题.以为是xml头写的 ...

随机推荐

  1. linux----------linux的scp命令介绍

    1.scp是有Security的文件copy,基于ssh登录. 命令基本格式: scp [OPTIONS] file_source file_target OPTIONS: -v 和大多数 linux ...

  2. “流式”前端构建工具——gulp.js 简介

    Grunt 一直是前端领域构建工具(任务运行器或许更准确一些,因为前端构建只是此类工具的一部分用途)的王者,然而它也不是毫无缺陷的,近期风头正劲的 gulp.js 隐隐有取而代之的态势.那么,究竟是什 ...

  3. 玩转spring boot——负载均衡与session共享

     前言 当项目上线后,如果要修复bug或扩充功能,都需要重启tomcat服务.此时,正在使用应用的用户们就需要等待服务器的重启,而这就会造成不好的用户体验.还有,当仅仅只有一台tomcat服务时,如果 ...

  4. 详解Python变量在内存中的存储

    这篇文章主要是对python中的数据进行认识,对于很多初学者来讲,其实数据的认识是最重要的,也是最容易出错的.本文结合数据与内存形态讲解python中的数据,内容包括: 引用与对象 可变数据类型与不可 ...

  5. consul 集群

    主机运行 : consul agent -server -bootstrap-expect 2  -data-dir D:\consul  -node=winyh -bind=192.168.10.1 ...

  6. 基于ROS和python,通过TCP通信协议,完成键盘无线控制移动机器人运动

    一.所需工具包 1.ROS键盘包:teleop_twist_keyboard 2.TCP通讯包:socket $ cd ~/catkin_ws/src $ git clone https://gith ...

  7. K8S学习笔记之Kubernetes数据持久化方案

    在开始介绍k8s持久化存储前,我们有必要了解一下k8s的emptydir和hostpath.configmap以及secret的机制和用途. 0x00 Emptydir EmptyDir是一个空目录, ...

  8. 剑指offer(8)跳台阶

    题目描述 一只青蛙一次可以跳上1级台阶,也可以跳上2级.求该青蛙跳上一个n级的台阶总共有多少种跳法. 题目分析 题目很简单,稍微分析就知道这是斐波那契数列,所以可以动态规划来做 a.如果两种跳法,1阶 ...

  9. 【问题解决:SFL4J】启动时SLF4J报错

    问题描述 启动时报错 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Default ...

  10. easyUI使用dailog实现弹出框带表单功能

    本文为博主原创,未经允许不得转载: 示例如下: 需要注意的地方在id为win的div中需要有:closed="true"这个属性,这个属性为控制dailogn对话框显示与隐藏的属性 ...