javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception

来源:互联网 发布:微信h5页面制作源码 编辑:程序博客网 时间:2024/05/29 11:05
在访问springmvc项目的时候,浏览器提示
javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception控制台提示:org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springmvc.xml]; nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be opened because it does not exist一开始以为是文件名错误,确认文件名没有错误并重新访问还是有错误。后来发现问题出现在建文件夹的时候,类型是Folder,在web.xml里面配置成 <param-value>classpath:springmvc.xml</param-value>是无法访问到,把文件夹的类型修改成Source Folder之后就可以访问成功了
因为Source Folder存放的是java源文件,Folder存放的任何文件,包括java源文件、图片等。
Source Folder的java文件会被编译,但是Folder不会,只是被当成普通文件,所以编译的时候不会错,但是运行的时候就不一定
阅读全文
0 0
原创粉丝点击