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


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


  

    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  
  
   
     PROPAGATION_REQUIRED
     PROPAGATION_REQUIRED
     PROPAGATION_REQUIRED
     PROPAGATION_REQUIRED,readOnly
   

  



      


    

... ....
启动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?
解决办法


    

换成以下代码就可以正常运行了

      
           
                
           

      

 

 

文章出自:http://zhengweisincere.blog.163.com/blog/static/49844649201171012515667

 

 

 

 

 

你可能感兴趣的:(java)