Eagerly caching bean '' to allow for resolving potential circular references

tomcat啓動時卡在:

一般這樣的問題是兩個原因:

1. 數據庫連接不上;

2. mapper.xml 中有錯誤,比如單詞拼寫錯誤;

這個問題不是,採取的方法是 把項目的日誌級別調整爲debug模式,查看詳細打印信息:

DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean 
    with name 'crashMetaLogDAO' defined in URL [jar:file:/D:/dev_software/workplace/gitWorkplace/appupgrade/app-upgrade-admin/target/app-upgrade-admin/WEB-INF/lib/app-upgrade-module-1.0-SNAPSHOT.jar!
    /com/bbkmobile/iqoo/appupgrade/statistic/crashdata/dao/CrashMetaLogDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : 
No qualifying bean of type [org.apache.ibatis.session.SqlSessionFactory] is defined: expected single matching bean but found 2: sqlSessionFactory,statisticSqlSessionFactory;
nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.apache.ibatis.session.SqlSessionFactory] is defined:
expected single matching bean but found 2: sqlSessionFactory,statisticSqlSessionFactory
DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'sqlSessionFactory'
DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'statisticSqlSessionFactory'
DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Ignoring bean creation exception on FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean 
    with name 'userDAO' defined in URL [jar:file:/D:/dev_software/workplace/gitWorkplace/appupgrade/app-upgrade-admin/target/app-upgrade-admin/WEB-INF/lib/app-upgrade-core-1.0-SNAPSHOT.jar!
    /com/bbkmobile/iqoo/appupgrade/core/user/dao/UserDAO.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory': : 
No qualifying bean of type [org.apache.ibatis.session.SqlSessionFactory] is defined: expected single matching bean but found 2: sqlSessionFactory,statisticSqlSessionFactory;
nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [org.apache.ibatis.session.SqlSessionFactory] is defined: 
expected single matching bean but found 2: sqlSessionFactory,statisticSqlSessionFactory
DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'crashMetaLogDAO'
DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating instance of bean 'crashMetaLogDAO'
DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'crashMetaLogDAO' to allow for resolving potential circular references
2017-02-12 20:48:54.040 DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'userDAO'
2017-02-12 20:48:54.040 DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Creating instance of bean 'userDAO'
2017-02-12 20:48:54.040 DEBUG o.s.b.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'userDAO' to allow for resolving potential circular references

statistic-spring-mybatis.xml


<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage"
              value="xxx.xxx.xxx.statistic.*.dao"/>
</bean>

spring-mybatis.xml

<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage"
              value="xxx.xxx.xxx.x.core.*.dao"/>
</bean>
 兩個spring-mybatis.xml 的MapperScannerConfiguer中 都沒有指定sqlSessionFactory。
--------------------- 
作者:sumi 
來源:CSDN 
原文:https://blog.csdn.net/wconvey/article/details/55006768 
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章