admin
管理员
管理员
  • UID1
  • 粉丝1
  • 关注0
  • 发帖数378
  • 社区居民
  • 忠实会员
  • 原创写手
阅读:805回复:0

org.springframework.beans.factory.BeanCreationException

楼主#
更多 发布于:2015-12-23 09:06
错误日志:




[java] view plaincopy

  1. Error creating bean with name 'factwishPage': Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factwishWindow': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'factwishWindow': Requested bean is currently in creation: Is there an unresolvable circular reference?  
  2. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factwishPage': Injection of resource fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factwishWindow': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'factwishWindow': Requested bean is currently in creation: Is there an unresolvable circular reference?  
  3.    at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessAfterInstantiation(CommonAnnotationBeanPostProcessor.java:293)  
  4.    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:957)  
  5.    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)  
  6.    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)  
  7.    at java.security.AccessController.doPrivileged(Native Method)  
  8.    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)  
  9. ...    


错误原因分析:
      此类错误是SpringBean名称重复,例如如果某个dao的名字为"DAO",而又配置了一个相同名字的bean.
解决方案:
     这里我使用了ZK的ZETA设计方法,将所有zk组件交给spring当作bean管理,在页面某个组件误写为另外一个页面的窗口id.




[c-sharp] view plaincopy

  1. <label value="@{factwishPage.overdue,converter='mo.org.sgvd.ui.convert.ConvertDate' }" />  
 

此处factwishPage误写为另外页面的窗口名.故spring会尝试创建这个bean,但另外一个页面已经创建了此bean.所以会报以上异常.将名称改写factoralPage后正常

 

 

 

 

 

 

 

异常中心网是一家专门收集整理程序员编程过程中遇到的常见异常(exception)以及各种异常问答中心的网站。异常中心网旨在,减少程序员在编码遇到异常,处理各种异常时间和痛苦,让程序员能更愉快的、快速的定位异常并查找对应的异常解决方案。异常中心网诚心打造最完美的编程社区为程序员用户服务,努力成为最好的程序员乐园程序员社区程序异常中心程序bug中心异常问答中心

 

喜欢0 评分0
游客

返回顶部