背景:
想用容器接收spring boot 启动加载的bean
1、新建了个spring boot项目,
2、搞了个PandaService类,写个hello 方法,简单输出
3、在启动类main方法中,用容器ApplicationContext
去接收启动加载的类
4、通过反射获取PandaService
对象,调hello方法
5、代码结构如图,so easy
启动报错如下:
Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.service.impl.PandaServiceImpl' available
at org.<