servlet.xml 出現 Referenced file contains errors(http://.......)

問題描述:spring

打開Eclipse忽然發現Web工程的servlet.xml忽然報了紅叉叉,錯誤信息以下:spa

Referenced file contains errors (http://www.springframework.org/schema/tool/spring-tool-3.0.xsd). For more information, right click on the orm

message in the Problems View and select "Show Details..."xml

 

以前這個文件是沒問題的,網上找了不少方法,發現了緣由,解決辦法以下:ip

1. 首先爲了確保 Eclipse 能夠從遠程拿到 xsd 文件,到 Window -> Preferences -> General -> Network Connections -> Cache 下的 Cache entries 框內檢查所須要的文件是否正確,若是不肯定,就點擊 "Remove All",而後右擊當前的 Project 選擇 Validator,Eclipse 會從新加載 xsd 文件;servlet

PS:個人報錯就是由於spring-tool出現了多個版本,從新Validate以後就沒錯了io

 

2. 若是錯誤依舊,那就須要刪掉 xsd 文件的版本號,例如:form

http://www.springframework.org/schema/context/spring-tool-3.0.xsd
cli

改爲: http://www.springframework.org/schema/context/spring-tool.xsddate

相關文章
相關標籤/搜索