xml文件時第一行無緣無故報錯


 

 

錯誤信息:

Referenced file contains errors (http://www.puppycrawl.com/dtds/configuration_1_3.dtd). For more information, right click on the message in the。。。。之類的。

我這里是做的是spring的applicationContext.xml文件的,所以會報spring框架的約束格式錯誤。

下面總結一下幾種解決辦法。

第一種:點擊eclipse左上角菜單欄 Project->clean 清理一下你所出現問題的項目。不僅這個問題,還有很多奇怪的問題都可以通過這種方式解決

第二種:首先為了確保 Eclipse 可以從遠程拿到 xsd 文件,到 Window -> Preferences -> General -> Network Connections -> Cache 下的 Cache entries 框內檢查所需要的文件是否正確,如果不確定,就點擊 “Remove All”,然后右擊當前的 Project 選擇 Validator,Eclipse 會重新加載 xsd 文件;

第三種:如果錯誤依舊,那就需要刪掉 xsd 文件的版本號,例如:

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

改成: http://www.springframework.org/schema/context/spring-context.xsd

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM