问题以下:原先运行正常的项目,忽然在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