我新建springmvc 项目demo,报错:
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springmvcconfig.xml]; nested exception is java.io.FileNotFoundException: class path resource [springmvcconfig.xml] cannot be opened because it does not exist
但是,springmvcconfig.xml文件在我的src文件夹下面:
jdk是1.8
spring 是5.2.7
tomcat 是8.5
建议你先确认一下class path resource
的位置,该方件夹应该并不是你所想像的src文件夹。
如果你的项目遵循了官方的Spring MVC的目录结构class path resource
的位置应该是:src/main/resources
你的是eclipse所以要放到 src/main/webapp/WEB-INF ,默认的名字是 springmvc-servlet.xml
如果是idea springmvc的配置文件就直接放到 resource目录下 ,你可以尝试一下