当前位置:网站首页>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即可


边栏推荐
猜你喜欢
随机推荐
Proe/Creo智能硬件产品结构设计要点「干货分享」
Bugs encountered in remote control projects
Transformer前言:self-attention与Multi-Headed Attention的详细理解
<力扣刷题>965. 单值二叉树
js文件的处理
【元胞自动机】基于元胞自动机模拟社会力因素下的灾害人员疏散应急仿真附matlab代码
全文翻译:EDPB 基于设计和默认的数据保护指南
【图像增强】基于Step和Polynomial 滤波实现图像增强附matlab代码
轻量化神经网络--MobileNet v3学习记录
大计算量优化方法总结
字符串压缩
任务六 特征衍生 案例分析
A double non-programmer interviewed Ant, Meituan, Ctrip and other big companies with offers to share the interview process
全文翻译:EDPB数据保护影响评估(DPIA:Data Protection Impact Assessment)指南
【物理应用】基于El-centro地震波作用下隔震与非隔震支座下的顶层位移、速度、加速度的对比情况附matlab代码
4-8 Matplotlib库 雷达图
浅谈自定义应用层协议与UDP的报文结构和注意事项
Oracle最后一个商用免费版本JDK1.8.202
4-1 Matplotlib库 数据分析常用图
入门数据库Days6









