org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/springmvc1.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/springmvc1.xml] cannot be opened because it does not exist
springmvc提示找不到配置文件,但是那个配置文件你确实能看到,但是启动就报错,可能是配置文件没有编译到对应的目录
**.xml文件如果在WEB-INF下的话应该不会报错,如果你放到了别的文件夹(配置中的是resources),但是没有相应的配置,一定会报错
在pom文件中build中需要如下配置
<resources>
<!-- 使用Maven部署的时候,xml和properties配置文件也一起部署到Tomcat -->
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>false</filtering>
</resource>
<!-- 默认是以下配置 -->
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.conf</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>