在做SSM整合的时候,tomcat服务器一启动就报如下的错误,

class path resource [SpringMvc.xml] cannot be opened because it does not exist意思是找不到路径下的文件资源,如下是我的工程框架图

class path resource [SpringMvc.xml] cannot be opened because it does not exist

下面是我的Web.xml中的配置

class path resource [SpringMvc.xml] cannot be opened because it does not exist

明明已经配置了SpringMvc.xml,却提示没有该文件, 但这些文件不能在任意的地方,必须使用build path 放到指定的位置才可以访问到。

步骤:

选中项目=>(右键)properties=>Java Build Path =>Source =>Add Folder

class path resource [SpringMvc.xml] cannot be opened because it does not exist

将存放 SpringMvc.xml文件的config文件夹添加到Source Folder,应用,重新启动服务器即可。

相关文章: