Springboot 启动时Bean初始化,启动异常-Assert.isTrue(condition,message) 报错

Springboot 启动时Bean初始化启动异常Assert.isTrue(condition,message) 报错,如果 condition为false 则会出现

java.lang.IllegalArgumentException: message,

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘XXXXXX’ defined in class path resource 异常

总结: 

@Configuration 注解中定义bean, @Bean 如果Bean中出现异常则会立即抛出,终止springboot启动

猜你喜欢

转载自www.cnblogs.com/outxiao/p/10348215.html