问题描述
项目在Tomcat上运行后,http://localhost:8080/HiSpring/
在浏览器报错:
Error Description: The origin server did not find a currnt representation for the target resource or it not willing to disclose that one exists.
分析:
在控制台中发现,server启动的时候并没有读取项目的web.xml文件,更别说加载其他的配置文件,说明项目根本就没跑起来。
那么web.xml文件是如何读取到的?
右键项目->properties->Deployment Assembly
发现项目的部署List文件下并没有 web.xml文件所在的目录,即没有web.xml文件所在的webapp目录。
将该目录添加到部署到项目下:
添加后:
重新启动Server,web.xml文件被加载,并且相关配置文件被加载,问题解决。