一般出现这样的错误,日志打印很长,稍微不注释加上失去耐心,就会查询问题很久,spring一般报错误都是由上到下的进行提示。比如a调用b b调用c,c调用d,d有问题,一般看到的日志时a-b-c-d这样大概的顺序描述。
例如
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.wt.pts.service.QryProductService': Cannot resolve reference to bean 'qryProductServiceImpl' while setting bean property 'ref'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'qryProductServiceImpl': Unsatisfied dependency expressed through field 'productQryManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'productQryManager': Unsatisfied dependency expressed through field 'qryPtsTradeManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'qryPtsTradeManager': Unsatisfied dependency expressed through field 'qryPtsBalanceService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'qryPtsBalanceService': Unsatisfied dependency expressed through field 'qryPtsBalanceManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'qryPtsBalanceManager': Unsatisfied dependency expressed through field 'contractManager'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'contractManager': Unsatisfied dependency expressed through field 'localOpenService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.wt.pts.remote.LocalOpenService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
上面这么长一段描述的是Error creating bean with name 'com.wt.pts.service.QryProductService
然后 Cannot resolve reference to bean 'qryProductServiceImpl' while setting bean property 'ref';
再然后
Error creating bean with name 'qryProductServiceImpl': Unsatisfied dependency expressed through field 'productQryManager';
等等一直看到最后其实这这个错误
No qualifying bean of type 'com.wt.pts.remote.LocalOpenService' available: expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
LocalOpenService 不能注入