当前位置:网站首页>class path resource [bean.xml] cannot be opened because it does not 错误解决方案
class path resource [bean.xml] cannot be opened because it does not 错误解决方案
2022-08-09 01:13:00 【那人独钓寒江雪.】
运行spring注入方式的时候出现错误
@Test
public void testAdd(){
ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
User user = context.getBean("user", User.class);
System.out.println(user);
user.add();
}
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource [bean.xml]; nested exception is java.io.FileNotFoundException: class path resource [bean.xml] cannot be opened because it does not exist
解决方案
- 将bean1从根目录上的包 移入到resources即可
边栏推荐
猜你喜欢
随机推荐
微信企业号开发之获取AccessToken
Qt中QFile、QByteArray QDataStream和QTextStream区别
LVGL简介(基于v8.1-8.2)
5-2 Seaborn 分类绘图
Network In Network学习记录
全文翻译:欧盟第29条数据保护工作组 数据保护官指南
5-1 Seaborn 关系绘图
入门数据库Days5
Region Proposal Network(RPN)
容器运维平台的故障处理-1
4-1 Matplotlib库 数据分析常用图
【科研-学习-pytorch】3-分类问题
JSON基础,传递JSON数据,介绍jackson、gson、fastjson、json-lib四种主流框架!
字节输入流(InputStream)与字节输出流(OutputStream)
进程和线程
4-11 Matplotlib 配置
如何准备一份简历
【科研-学习-pytorch】5-boardcasting、合并分割
【元胞自动机】基于元胞自动机模拟社会力因素下的灾害人员疏散应急仿真附matlab代码
「复盘」面试 BAMT 回来整理 398 道高频面试题,助你拿高薪 offer