[本文版权归微信公众号"代码艺术"(ID:onblog)所有,若是转载请务必保留本段原创声明,违者必究.若是文章有不足之处,欢迎关注微信公众号私信与我进行交流!] 在项目中,我们可能需要手动获取spring中的bean对象,这时就需要通过 ApplicationContext 去操作一波了! 1.直接注入(Autowired) @Component public class User { @Autowired private ApplicationContext application
Description: The bean 'userService' could not be injected as a 'com.phy.hemanresoruce.service.UserService' because it is a JDK dynamic proxy that implements: Action: Consider injecting the bean as one of its interfaces or forcing the use of CGLib-bas