• Eclipse 中报错的阅读顺序


     1  1 九月 19, 2018 8:49:53 上午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions    
     2  2 資訊: Loading XML bean definitions from class path resource [ApplicationContext.xml]    
     3  3 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?    
     4  4     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
     5  5     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
     6  6     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1477)
     7  7     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
     8  8     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
     9  9     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    10 10     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    11 11     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    12 12     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    13 13     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    14 14     at com.wisely.highlight_spring4.ch1.di.BeanFactoryTest.main(BeanFactoryTest.java:14)
    15 15 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?    
    16 16     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1514)
    17 17     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1222)
    18 18     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
    19 19     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    20 20     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    21 21     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    22 22     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    23 23     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    24 24     at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
    25 25     ... 10 more
    26 26 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?    
    27 27     at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1076)
    28 28     at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:927)
    29 29     at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:95)
    30 30     at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
    31 31     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1510)
    32 32     ... 18 more
    View Code

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

  • 相关阅读:
    新闻发布系统之 登陆注销
    readonly和const的区别
    c#中文件流的读写
    解决jsp两种提交方式乱码 的方法
    B/S 和 C/S两种架构
    App.config的典型应用
    接口实现多态
    Spring概念
    在Spring的核心配置文件applicationContext.xml中配置事务,主要配置三大方面:事务管理器、事务通知和定义事务性切面。
    乱码问题解决方案
  • 原文地址:https://www.cnblogs.com/hoonick/p/9820675.html
Copyright © 2020-2023  润新知