class path resource [logConfig.xml] cannot be resolved to URL because it does not exist

前端之家收集整理的这篇文章主要介绍了class path resource [logConfig.xml] cannot be resolved to URL because it does not exist前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

新项目部署后启动报错:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalArgumentException: Invalid 'log4jConfigLocation' parameter: class path resource [logConfig.xml] cannot be resolved to URL because it does not exist

到部署的tomcat文件夹中查看

编译后的文件中,WEB-INF的classes文件夹中确实是缺失了配置文件。因此,需要在编译前,将配置文件所在的resources目录添加为build path 右键package树上的resources文件夹,->build to path ->Add to… 然后重新部署编译即可。

猜你在找的XML相关文章