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

编程知识 更新时间:2023-05-01 23:39:31

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。

更多推荐

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

本文发布于:2023-04-24 14:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/5163f816db9be1f140a2ed58c2968744.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:bean   caching   Eagerly   resolving   references

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 100723文章数
  • 26064阅读数
  • 0评论数