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。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值