专业的JAVA编程教程与资源

网站首页 > java教程 正文

Spring问题之提示文件不存在处理it does not exist

temp10 2024-10-06 02:09:05 java教程 8 ℃ 0 评论

Spring问题:class path resource [org.springapplicationContext.xml] cannot be opened。

Spring问题:org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/root-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/root-context.xml] cannot be opened because it does not exist 。

Spring问题之提示文件不存在处理it does not exist

字面意思是:spring路径下的root-context.xml文件不存在!这个就有点扯了。web.xml配置的没有问题,文件也是确实存在的。如果是用IDEA开发的话,会看到这行配置是红色警告的,当时没有注意。

怀疑没有把该目录加进来,资源没有被加载编译。选中项目,选择Open Module Settings,果然没有,选择红框Resources添加整个目录。

添加后的如下,完成!启动后没有报错,完美!

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表