applicationContext.xml 文件頭報錯Referenced file contains errors

問題以下:原先運行正常的項目,忽然在applicationContext.xml 文件頭報錯spring

    

內容:Referenced file contains errors (http://www.springframework.org/schema/tx/spring-tx.xsd). For more   information, right click on the message in the Problems View and select "Show Details..."瀏覽器

緣由分析:若是使用Maven構建項目,spring在加載xsd文件時老是先試圖在本地查找xsd文件(spring的jar包中已經包含了全部版本的xsd文件),若是沒有找到,纔會轉向去URL指定的路徑下載。因此出現該狀況通常是由於斷網或spring的官網暫時沒法鏈接致使的。 能夠經過在瀏覽器輸入xsd文件的URL,如:spring-beans的話,輸入http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 進行確認。app

可是此次我沒有使用Maven,jar包都是在本地發佈的,因此排除以上緣由。spa

換個思路:orm

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

                 

 

2. 最簡捷的方法是刪掉 xsd 文件的版本號(這裏已經刪除了,但仍報錯,故採起method 1)。blog

相關文章
相關標籤/搜索