粗心大意害死人-----Bean property 'transactionAttributSource' is not writable or has an invalid setter method. Did you mean 'transactionAttributeSource'?

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dogService' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionAttributSource' of bean class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean]: Bean property 'transactionAttributSource' is not writable or has an invalid setter method. Did you mean 'transactionAttributeSource'?
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1344)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.Test.ormRun.method3(ormRun.java:55)
    at com.Test.ormRun.main(ormRun.java:18)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionAttributSource' of bean class [org.springframework.transaction.interceptor.TransactionProxyFactoryBean]: Bean property 'transactionAttributSource' is not writable or has an invalid setter method. Did you mean 'transactionAttributeSource'?
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1012)
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:857)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
    at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1341)

 

这是spring里面的某个属性找不到setter方法导致注入失败建立bean对象失败的错误。我出现这个错误的原因是属性transactionAttributeSource写成了transactionAttributSource,导致在bean 中找不到属性的rsetter方法报错。

posted @ 2016-05-11 09:38  guodaxia  阅读(509)  评论(0编辑  收藏  举报