[Spring框架学习]SSM 整合,使用maven构建项目的时候,启动项目报错class path resource [config/spring/springmvc.xml] cannot be

 错误:class path resource [config/spring/springmvc.xml] cannot be opened because it does not exist

  错误原因:找不到我的springmvc.xml,在下面web.xml中是我引用路径,网上找到问题classpath指向路径不是resource路径,所以一直找不到我的xml文件,

  classpath:到你的class路径中查找文件,

  classpath*:不仅包含class的路径,还包括jar文件中(class路径)进行查找

  解决办法:在classpath后面在上“*” 可解决问题,“classpath*:springmvc.xml”

很奇怪这个错误,明明配置和路径都没弄错.

image.png

猜你喜欢

转载自blog.csdn.net/qq_26834611/article/details/85133929