zoukankan      html  css  js  c++  java
  • 错误调试记录2

    bean 1

    <bean id="rebateInBo" class="com.shunwang.swpay.rebate.bo.imp.RebateInBoImp" >

          <property name="dao">
               <ref bean="rebateInDao"/>
          </property>
          <property name="rebateOutBo">
               <ref bean="rebateOutBo"/>
          </property>
         
           <property name="bussPartnerBo">
               <ref bean="bussPartnerBo"/>
          </property>
         
     </bean>

    bean 2

    <bean id="rebateOutBo" class="com.shunwang.swpay.rebate.bo.imp.RebateOutBoImp">
          <property name="dao">
               <ref bean="rebateOutDao"/>
          </property>
          <property name="rebateInBo">
               <ref bean="rebateInBo"/>
          </property>
     </bean>

    启动异常:

    [ERROR]2011-03-11 14:53:29,687 MESSAGE : Context initialization failed
    org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'rebateInBo': Bean with name 'rebateInBo' has been injected into other beans [rebateOutBo] in its raw version as part of a circular reference, but has eventually been wrapped (for example as part of auto-proxy creation). This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:431)
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)

    解决方法:

    lazy-init="true" 加到一个bean的属性里就好了,如下:

    <bean id="rebateInBo" class="com.shunwang.swpay.rebate.bo.imp.RebateInBoImp"  lazy-init="true">

          <property name="dao">
               <ref bean="rebateInDao"/>
          </property>
          <property name="rebateOutBo">
               <ref bean="rebateOutBo"/>
          </property>
         
           <property name="bussPartnerBo">
               <ref bean="bussPartnerBo"/>
          </property>
         
     </bean>


     

  • 相关阅读:
    把一元可以分解成几个1毛,2毛,5毛?
    记录集导出到Excel方法
    MySQL数据库加密与解密:
    运行时错误'430': 类不支持自动化或不支持期望的接口。New ADODB.Connection问题
    instrrev 和instr 区别vb
    解决用 VB 中用 ADO 访问 数据库时 SQL 查询处理 Null 值的问题( 使用 iff(isNull(字段), 为空时的值,不为空时的值) 来处理)
    Mysql SQL CAST()函数
    MySQL CAST与CONVERT 函数的用法
    一些网页链接
    git上传时出现ERROR: Repository not found.的解决办法
  • 原文地址:https://www.cnblogs.com/alaricblog/p/3278204.html
Copyright © 2011-2022 走看看