Invalid property 'transactionManager' of bean class的解决办法

Spring MVC 实体中List长度超过256报错问题 解决 报错信息如下: org.springframework.beans.InvalidPropertyException: Invalid property 'changeList[256]' of bean class [com.weichai.modules.performance.dto.PerformanceIndexForm]: Index of out of bounds in prope... 阅读详情
Invalid property 'transactionManager' of bean class的解决办法
2008-06-25 09:22

一个关于struts + spring + hibernate整合事务配置的问题(请教高手)
... ...
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
   <property name="sessionFactory" ref="sessionFactory"></property>
</bean>

<bean id="txProxyTemplate" abstract="true"
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
   <property name="transactionManager" ref="transactionManager"></property>
   <property name="transactionAttributes">
    <props>
     <prop key="create*">PROPAGATION_REQUIRED</prop>
     <prop key="update*">PROPAGATION_REQUIRED</prop>
     <prop key="delete*">PROPAGATION_REQUIRED</prop>
     <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
    </props>
   </property>
</bean>

<bean id="userDAO" class="dgut.ke.dao.impl.UserDAO">
       <property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<bean id="userService" parent="txProxyTemplate"   class="dgut.ke.service.impl.UserService">
     <property name="userDAO" ref="userDAO" />
</bean>
... ....
启动Tomecat时出了错.之前没有添加事务处理时.上面的代码是可以正常运行的.添加事务之后却出现以下错误
ERROR - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in ServletContext resource [/WEB-INF/applicationContext-hibernate.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [dgut.ke.service.impl.UserService]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by:
org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManager' of bean class [dgut.ke.service.impl.UserService]: Bean property 'transactionManager' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
解决办法

<bean id="userService" parent="txProxyTemplate"   class="dgut.ke.service.impl.UserService">
     <property name="userDAO" ref="userDAO" />
</bean>
换成以下代码就可以正常运行了
<bean id="userService" parent="txProxyTemplate">
       <property name="target">
            <bean class="dgut.ke.service.impl.UserService">
                 <property name="userDAO" ref="userDAO"></property>
            </bean>
       </property>
</bean>

接口报错500InvalidPropertyException: Invalid property ‘xxx[256]‘,@InitBinder的使用 从报错可以看到,前端传入参数个数大于256个,后端使用List接参,超出数组大小限制。 阅读详情

相关推荐

Invalid property 'mediaTypes' of bean class

Spring mvc4.2.5版本 与 3.2版本配置配置不同导致以下错误信息错误信息:2018-04-24 23:19:10,348 [main] [org.springframework.beans.factory.support.DefaultListableBeanFactory]-[DEBUG] Finished creating instance of bean 'org.spring...

lierjun 的专栏 2886

org.springframework.beans.NullValueInNestedPathException: Invalid property 'xxx' of bean class解决办法

在提交表单数据时出错,以下是出错信息。

斗鹰的技术专栏 7036

Invalid property 'initialSize' of bean class 问题解决

两种可能: 1.单词有没有错 2.commons-dbcp-1.2.2.jar,commons-pool-1.3包有没有引,包版本要在1.2以上 而我遇到的是第二个问题,而我这还纠结了一下,我的maven中引的版本是没有问题的, 查了好久,终于找到问题,原来代码使用的包是tomcat下的包,发现tomcat下的包版本不对, 替换后,正确

风车IT的专栏 4863

org.springframework.beans.InvalidPropertyException错误调试

org.springframework.beans.InvalidPropertyExceptionorg.springframework.beans.InvalidPropertyException错误调试,它是我在写Javaweb项目用ssh,时遇到的错误。出现这个错误主要原因有以下三点:1、spring的配置文件中的属性变量名要一致。2、要加入相应的get/set方法。3、总是报这错误,仔细...

abcd2333的博客 1万+

spring-02

前言IOC作用是控制反转,DI叫做依赖注入(给属性赋值)为属性赋值的方式:1.通过构造器为属性赋值。2.通过set方法为属性赋值。DI依赖注入代码spring02-11.set方法为属性赋值想要为属性赋值应该通过spring容器来做。要想为属性赋值必须要有set方法,容器通过形参传递参数给实参  属性才能正确赋值&lt;bean id="person" class="domain.Person"&...

tansuoliming的博客 205

Invalid property 'transactionManager' of bean clas

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34211761的博客 166

Invalid property '×××' of bean class

Bean注入属性的时候一直报错,Invalid property '×××' of bean class,检查了很多没发现有错,怎么会报无效的属性值。 最后发现是属性的SET方法没有写,这样就不能注入。...

iteye_239的博客 9550

Invalid property 'driver' of bean class [org.apache.commons.dbcp.BasicDataSource]

Spring整合MyBatis! main方法测试,出现异常: 一堆错,很懵逼! 别慌,慢慢分析,也许错误很简单; 先分析一下applicationContext.xml文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/bean...

学Java,找哪吒 2880

Spring整合Mybatis遇到Invalid property

##Spring+Mybatis整合遇到的Invalid property ‘XXX’ of bean class ‘XXXSercice’ :Bean property ‘XXX’ is not writable or has an invalid setter method 首先说说我遇到的情况吧,项目整合出现这个错,当时是问度娘找博客啦,但是他们找到的同错误的博文都没有解决到我的问题然后就...

JackeyMR的博客 2814

Spring Ioc容器

IOC:控制反转,把对象创建和对象之间的调用过程,交给 Spring 进行管理

逆流者的博客 290

Invalid property 'name' of bean class

Struts2 +  Hibernate4 +  Spring3.2 整合的时候出现的: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in cla

不懂不懂 1万+

InvalidPropertyException: Invalid property 'emp[accountName]' of bean class [com.ht.vo.NoticeDetailV

JDK1.7+Tomcat7.0+Eclipse+SSM+Bootstrap(含Bootstrap Table) 三月 09, 2019 10:27:52 上午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [SpringMVC] in context wit...

風的博客 7190

四、Invalid property 'dataSource' of bean class [xxx.dao.JdbcUserDao]: Bean property

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcUserDao' defined in class path resource [schema.xml]: Error setting property values; nested exception is org

9437

spring前端传递列表和数组限制大小256问题

项目遇到个问题,前段多勾了几个报错了,参数: 这样不会报错 一旦超过255就会报错 报错信息: 2020-10-14 14:32:35 |ERROR| com.zhzh.util.exception.GlobalExceptionHandler:60 (Exception:Invalid property 'menuIds[256]' of bean class [com.zhzh.model.common.SysRole]: Invalid array index in property path '

weixin_45352783的博客 1942

ssh 中使用c3p0 的连接池配置出错 Invalid property 'xxx' of bean class [com.mchange.v2.c3p0.ComboPoo

Invalid property 'xxx' of bean class [com.mchange.v2.c3p0.ComboPoo

guiguren的专栏 1万+
上一篇: SSO(Single Sign on)-单点登录收藏
下一篇: LDAP介绍
y_mo
博客等级 码龄21年 9粉丝 60原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值