git clone之前自己做的项目到本地运行,发现控制台报错了
报错内容:
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource
[applicationContext.xml]; nested exception is
java.io.FileNotFoundException: class path resource
[applicationContext.xml] cannot be opened because it does not exist
如下图:
原本以为是applicationComtext.xml
文件的红线(目前还是不知道怎么去掉这个提示)找不到路径,导致运行时报错。因此想解决这个提示问题,无从下手。
可能问题:Idea的Maven项目中target目录无配置文件
通过网友提示,发现是因为运行时生成的target目录没有包含资源配置文件。
原因:由于创建Maven工程的时候,资源目录是自定义的,命名为resources,并将它mark为资源目录root,(听说必须将其命名为resources才能正常使用,所以乱改名也可能出错)。