spring +mybatis,debug时 提示bean不能创建,但run时都正常。
spring +mybatis 中间层,debug调试时,提示 biProductStandardItemDao不能创建。
但仅仅是warn,而不是error。在tomcat 运行时,又是正常的,控制台不报提示。
为什么调试时会 出现warn,而运行时,没有出现提示,且能正常运行,不发生错误。
下面是debug时,具体显示的信息。
我花了很多时间找不到原因。
WARN o.s.b.f.s.DefaultListableBeanFactory - Bean creation exception on FactoryBean type check:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'biProductStandardItemDao'
defined in URL [jar:file:/D:/apache-tomcat-7.0.99/webapps/crm_service_web_war/WEB-INF/lib/
crm-service-business-1.0-SNAPSHOT.jar!/crm/core/quality/dao/BiProductStandardItemDao.class]:
Unsatisfied dependency expressed through bean property 'sqlSessionFactory': :
Error creating bean with name 'sqlSessionFactory' defined in class path resource [conf/spring/spring-datasource.xml]:
Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataSource' defined in class path resource [conf/spring/spring-datasource.xml]:
Invocation of init method failed; nested exception is java.lang.StackOverflowError;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sqlSessionFactory' defined in class path resource [conf/spring/spring-datasource.xml]:
Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataSource' defined in class path resource [conf/spring/spring-datasource.xml]:
Invocation of init method failed;
nested exception is java.lang.StackOverflowError