Method annotated with @Bean is called directly. Use dependency injection instead. 未添加@Configuration注解,导致@Bean之间相互调用出错 因此把类名上面增加@Configuration注解即可解决。