问题如下:原先运行正常的项目,突然在applicationContext.xml 文件头报错

内容: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 进行确认。

但是这次我没有使用Maven,jar包都是在本地发布的,所以排除以上原因。

换个思路:

1. 首先为了确保 Eclipse 可以从远程拿到 xsd 文件,到 Window -> Preferences -> General -> Network Connections -> Cache 下的 Cache entries 框内检查所需要的文件是否正确,如果不确定,就点击 "Remove All",然后右击当前的 Project 选择 Validator,Eclipse 会重新加载 xsd 文件;

                 

2. 最简捷的方法是删掉 xsd 文件的版本号(这里已经删除了,但仍报错,故采取method 1)。

applicationContext.xml 文件头报错Referenced file contains errors的更多相关文章

  1. Eclipse 中 Spring 项目的 XML 配置文件报错 Referenced file contains errors

    原来运行正常的项目,突然在applicationContext.xml 文件头报错 总结一下网上的解决方案: 1.有可能网络状况不好导致 如果使用Maven构建项目,spring在加载xsd文件时总是 ...

  2. 【转】IDEA中xml文件头报错:URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)

    有时候在IDEA中配置spring文件时会出现这个错误  URI is not registered (Settings | Languages & Frameworks | Schemas ...

  3. Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-3.0.xsd)

    问题: java项目在Eclipse中xml有小红叉 Problems:Referenced file contains errors (http://www.springframework.org/ ...

  4. web.xml文件头出错

    原先将web.xml文件头设置为如下格式 <?xml version="1.0" encoding="UTF-8"?><web-app ver ...

  5. Referenced file contains errors (xml文件第一行小红叉错误)

    转自:http://www.manongjc.com/article/30401.html 在eclipse中开发网页时,经常会遇到写xml文件时第一行无缘无故报错.在最左面的行数上面报出一个小红叉, ...

  6. eclipse配置文件出现小红叉,Referenced file contains errors (xml文件第一行小红叉错误)

    原文链接:https://blog.csdn.net/zlj1217/article/details/61432437                                          ...

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

    问题描述: 打开Eclipse突然发现Web工程的servlet.xml突然报了红叉叉,错误信息如下: Referenced file contains errors (http://www.spri ...

  8. IDEA中写MyBatis的xml配置文件编译报错的坑

    IDEA中写MyBatis的xml配置文件编译报错的坑 说明:用IDEA编译工具在项目中使用Mybatis框架,编写mybatis-config.xml和Mapper.xml配置文件时,编译项目出现错 ...

  9. 导入java web项目时 web.xml第一行报错

    报错信息: Referenced file contains errors (http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd). For more infor ...

随机推荐

  1. PreparedStatement 和 Statement 实现基本的批处理

    批处理:若需要对数据库进行多步操作,则就没必要每次都和数据库进行一次通信,这样很消耗资源和时间.则需要将操作进行批处理:    Statement方式来实现批处理        优点:         ...

  2. windows8安装docker(tool box)

    打开 https://store.docker.com/editions/community/docker-ce-desktop-windows 下载安装包文件 双击安装Docker 出现错误非Win ...

  3. [bootstrap] 修改字体

    file: variable.less @font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-seri ...

  4. CF 990C. Bracket Sequences Concatenation Problem【栈/括号匹配】

    [链接]:CF [题意]: 给出n个字符串,保证只包含'('和')',求从中取2个字符串链接后形成正确的括号序列的方案数(每个串都可以重复使用)(像'()()'和'(())'这样的都是合法的,像')( ...

  5. 集训day15 t1 poj3728

    [问题描述] 有一颗n个节点的树 每个节点上都有许多奸商在卖东西,第i个奸商的理想价格为vi,即他会以vi的价格购买或卖出一件东西 有m个人希望从树上的某个点走到另一个点,问你在只进行一次买卖(每次仅 ...

  6. Scala 实现快速排序和归并排序

    def quickSort1(array: Array[Int]): Array[Int] = { def swap(x: Int, y: Int): Unit = { val tmp = array ...

  7. HDU1142 A Walk Through the Forest(dijkstra)

    A Walk Through the Forest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Jav ...

  8. luogu P2024 食物链

    题目描述 动物王国中有三类动物 A,B,C,这三类动物的食物链构成了有趣的环形.A 吃 B,B 吃 C,C 吃 A. 现有 N 个动物,以 1 - N 编号.每个动物都是 A,B,C 中的一种,但是我 ...

  9. ListView控件(下)简单适配器

    (一) 1.效果图 2.activiy_main.xml <?xml version="1.0" encoding="utf-8"?> <Li ...

  10. Swift中混编OC第三方库

    现在Swift的第三方库还比较少,有时候需要使用OC的第三方库,其实也是很容易的.   我们使用如下步骤: 1.新建的Swift项目,第一次创建OC文件时会询问是否生成 桥接头,选择是的话会生成一个桥 ...