咱就是说为啥报错找不到xml文件,xml文件不是存在吗?

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
运行结果及报错内容
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="user" class="com.atguigu.spring5.userDaoImpl"></bean>
<bean id="service" class="com.atguigu.spring5.Service">
    <constructor-arg ref="user"></constructor-arg>
</bean>
</beans>

IOException parsing XML document from class path resource [lol.xml]; nested exception is java.io.FileNotFoundException: class path resource [lol.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)

img

img

我的解答思路和尝试过的方法
我想要达到的结果

使用spring5框架注入对象

img

题主贴下 Test 类文件的代码,第 9 行文件地址配置有误,尝试修改为 classpath:com/atguigu/spring5/lol.xml,要是还找不到确认下有没有把这个资源文件编译到类路径。

读取文件得路径不对