【发布时间】:2016-04-03 07:59:45
【问题描述】:
根据参考using-boot-configuration-classes,我在Application类上使用@ComponentScan,在我的配置类上使用@Configuration,在我的配置类中,我想通过使用@987654324注入其他配置类中定义的bean @ 注释,但是当我运行应用程序时,这些字段为 null,我尝试在应用程序上使用 import 并从配置类中删除 @Configuration,一切正常。
是spring boot的bug还是我对@Configuration注解的用法有误解?
【问题讨论】:
-
你能分享你的代码吗
-
spring boot 没有错误...适用于很多人..可能您的课程布局不正确..请分享您的布局或看看示例..
标签: spring configuration null spring-boot autowired