首页  

eclipse异常断点设置     所属分类 java 浏览量 1414
以 spring 自动装配 找不到bean异常为例

@Autowired  @Qualifier("catNotExist")
private Pet cat;


Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'zoo': Unsatisfied dependency expressed through field 'cat'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'scans.Pet' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=catNotExist)}


Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'scans.Pet' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=catNotExist)}


debug 页  右上角  有个 叹号的图标  
add java exception breakpoint
输入相应的异常

启动debug   在断点出 可查看上下文信息

上一篇     下一篇
spring aop cglib 代理类源码查看

Properties使用UTF8读取中文配置文件

spring5自动装配实例

eclipse设置条件断点和异常断点

spring5属性及内嵌属性解析

反射获取字段注意点