使用了Spring的依赖,上一秒还很正常,测试运行的时候报错了:程序包org.springframework.stereotype不存在,尝试过重启idea和重新导入依赖都没有用,现在回忆起来好像经常这样,前几天还好好的项目,过几天就没依赖了。现在这个也是,上午还正常的,下午这个错出来以后,也报错了。
{
String config ="applicationCotext";
// 创建容器对象
ApplicationContext alc = new ClassPathXmlApplicationContext(config);
Student student =(Student) alc.getBean("student");
System.out.println(student);
}