Eclipse 中报错的阅读顺序

九月 19, 2018 8:49:53 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions	
資訊: Loading XML bean definitions from class path resource [ApplicationContext.xml]	
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'functionService' defined in class path resource [ApplicationContext.xml]: Cannot resolve reference to bean 'useFunctionService' while setting bean property 'useFunctionService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'useFunctionService' defined in class path resource [ApplicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'functionService' of bean class [com.wisely.highlight_spring4.ch1.di.UseFunctionService]: Bean property 'functionService' 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.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at com.wisely.highlight_spring4.ch1.di.BeanFactoryTest.main(BeanFactoryTest.java:14)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'useFunctionService' defined in class path resource [ApplicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'functionService' of bean class [com.wisely.highlight_spring4.ch1.di.UseFunctionService]: Bean property 'functionService' 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.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1514)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
	... 10 more
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'functionService' of bean class [com.wisely.highlight_spring4.ch1.di.UseFunctionService]: Bean property 'functionService' 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:1076)
	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:927)
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
	at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1510)
	... 18 more

如上的代码所示,从下往上阅读,调用顺序是从上往下的,最上面的代码是最外层的调用.最下面的代码是最底层的报错的位置.

猜你喜欢

转载自blog.csdn.net/baidu_33314976/article/details/83181278