錯誤信息:
“The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.”
解決方案(eclipse):
- 查看項目中是否存在兩個web.xml文件
- 移除tomcat server中所有的項目,然後clean一下,雙擊打開Tomcat Server服務器,檢查tomcat配置。
- 如果是新創建的server,默認的配置在Server Locations中是選中第一項的(User workspace metadata...),Deploy Path默認是wtpwebapps此時,要將其修改成下圖所示
修改完成之後保存,重新編譯項目,這時如果不出意外則可以正常運行了,如果依然報錯!
3. 檢查tomcat安裝目錄的webapps文件夾中是否存在與該項目相同的文件,比如該項目改過名稱(project01—>project02)
這時webapps文件夾中依然存在project01目錄,運行現在的項目時又會生成project02目錄,然而這兩個目錄的內在(web.xml)是一樣的!所以就會導致該錯誤,此時刪除這些目錄,重新運行tomcat server即可解決。