错误:Referenced file contains errors (http://struts.apache.org/dtds/struts-2.3.dtd). For more information,   right click on the message in the Problems View and select "Show Details..."

解决方法(两种):

1. 这个可能是你的DTD文件找不到,或者解析有错,才发生的错误.你可以在地址栏里输入http://struts.apache.org/dtds/struts-2.3 .dtd 这个看能查看不,如果不能,应该是网络的问题或XML解析的问题,解决的方法就是你把DTD文件拷贝到你的CLASSPATH目录下,把http://struts.apache.org/dtds/struts-2.3 .dtd 这个路径换成"/WEB-INF/classes/struts-2.3 .dtd "这样再试一下

2. 从struts2-core-2.x.x.jar中取出struts-2.3.dtd,打开[Window]-[Properties],打开对话框.在左边的树形列表中选择[MyEclipse]-[Files-Editors]-[XML]-[XML Catalog],此时右边显示相应的内容.在右边[XML Catalog Entries]下方有一个[Add]按钮,单击它,在弹出的对话框中输入:
          Location:UseStruts2/src/struts 2.3.dtd(这个选择你刚取出来的 struts-2.3.dtd文件)
          Key Type:Public ID
          Key:-//Apache Software Foundation//DTD Struts Configuration 2.3//EN
选择[OK]即可添加.

3.可能是版本问题(最常见):
看了一下,我的struts是2.3,然后修改了struts.xml对dtd的引用

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd">

在修改时我采用的是此种方法,打开Referenced Libraries,里面有struts2-core-2.x.x.jar包,可以看到多个Struts-2.x.dtd文件,那么就可以按照这几个文件在struts.xml的版本处修改。

改为:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">

当然了,如果错误是2.0.dtd,那么就试着改为2.1.dtd或者2.3.dtd

--------------------- 
作者:安心Smile 
来源:CSDN 
原文:https://blog.csdn.net/ANXIN997483092/article/details/72621858 
版权声明:本文为博主原创文章,转载请附上博文链接!

解决Referenced file contains errors相关推荐

  1. 关于解决Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.3.xs

    问题描述:在配置文件时头文件出现红x,且显示错误提示为: Referenced file contains errors (http://www.springframework.org/schema/ ...

  2. Spring 配置异常解决办法之Referenced file contains errors (http://www.sp

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

  3. Referenced file contains errors (http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_4.xsd).

    项目导入后,一个tld文件提示以下错误: Referenced file contains errors (http://java.sun.com/xml/ns/j2ee/web-jsptaglibr ...

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

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

  5. java配置文件报错_java使用spring框架配置文件时遇到的错误——Referenced file contains errors...

    报错信息: Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.3. ...

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

    Spring配置异常解决办法(Referenced file contains errors (http://www.springframework.org/schema/beans/spring-b ...

  7. mybatis 配置文件报错:Referenced file contains errors(file:/D:/config/ mybatis-3-mapper.dtd).

    JAVA就业套餐课:https://edu.csdn.net/combo/detail/1230 在项目搭建过程中,配置Mybatis配置文件时,出现错误:在UserMapper.xml头文件出现   ...

  8. spring mvc学习(15)Referenced file contains errors

    SSM项目中出现Referenced file contains errors (http://www.springframework.org/schema/mvc/spring-mvc-3.0.xs ...

  9. Referenced file contains errors (http://www.springframework.org/schema...错误--转载

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

  10. Referenced file contains errors (http://JAVA.sun.com/xml/ns/j2ee/web-app_2_5.xsd).

    Referenced file contains errors (http://Java.sun.com/xml/ns/j2ee/web-app_2_5.xsd). For more informat ...

最新文章

  1. 为iPhone6 设计自适应布局(一)
  2. iqoo升级鸿蒙,vivo iQOO 3升级更新PD1955_A_1.12.27固件rom全量刷机包
  3. FFMPEG视音频编解码学习(1)
  4. hdu 1043 Eight 搜索,哈希
  5. Linux基础操作优化
  6. 程序员的选房神技,GitHub上的房源爬虫
  7. html中显示shell脚本的输出,网页从shell脚本中输入并显示结果
  8. Jade/Pug模板引擎
  9. 3.过滤——简单移动平均线概念(SMA)、SMA的假设、加权移动平均线概念(WMA)_1
  10. 在Apache中利用ServerAlias设置虚拟主机接收多个域名和设置域名泛解析
  11. 传统方法做分割 解析种子cues
  12. Vue3配置路由ERROR in [eslint]报错问题
  13. 一张图读懂中国产业链的变化与机会
  14. 北京软件开发公司排名-最大的软件开发公司有哪些呢
  15. 我的世界刷猪人塔java版_我的世界猪人塔怎么做 5款猪人塔详解教程
  16. 淘宝双11大数据分析(环境篇)
  17. easyexcel导出excel文件合并相同单元格数据
  18. 基于JAVA学生会管理系统2021计算机毕业设计源码+系统+数据库+lw文档+部署
  19. 互联网IT行业岗位分析,程序员、CTO……都是什么?
  20. Adversarial Image Registration with Application for MR and TRUS Image Fusion

热门文章

  1. Arduino与Proteus仿真实例-HC-SRF04超声波测距仿真
  2. XBrowser增加Jslog日志对象接口
  3. 图片去水印的原理_图片中的水印怎么去除
  4. 【C++】 文件提取英文单词
  5. 图片像素大小怎么调整,批量调整图片像素
  6. amd显卡风扇调节_amd显卡风扇速度设置linux版本
  7. ODC预端接光纤配线箱
  8. 使用node爬取小说内容并保存到本地
  9. 花椒前端基于 Docker 的 SSR 持续开发集成环境实践
  10. 图计算的黄金时代 知识图谱背后的数据价值