Java web-app_2_5.xsd在eclipse中验证web.xml时显示错误

Java web-app_2_5.xsd在eclipse中验证web.xml时显示错误,java,xml,jakarta-ee,Java,Xml,Jakarta Ee,我不知道我能做些什么导致这一切,因为我花在编程上的时间太长了,我已经忘记了我可能会做什么。但现在当我加载Eclipse时,它会说: The errors below were detected when validating the file "web-app_2_5.xsd" via the file "web.xml". In most cases these errors can be detected by validating "web-app_2_5.xsd" directly.

我不知道我能做些什么导致这一切,因为我花在编程上的时间太长了,我已经忘记了我可能会做什么。但现在当我加载Eclipse时,它会说:

The errors below were detected when validating the file "web-app_2_5.xsd" via the file "web.xml".  In most cases these errors can be detected by validating "web-app_2_5.xsd" directly.  However it is possible that errors will only occur when web-app_2_5.xsd is validated in the context of web.xml. 
s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'JDK 6 XML-related APIs'.
The entity name must immediately follow the '&' in the entity reference.
我的前几行web.xml看起来是这样的

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 id="WebApp_ID" version="2.5">

我了解到,可能是从中检索文件的服务器出错,也可能是缓存出错。我已经禁用并清除了缓存,据我所知,服务器与其他所有人使用的服务器相同,除非他们切换到oracle.com url,而我还没有找到它


任何想法都将不胜感激

请查看您的web.xml

是否有任何´&´-符号后面没有已知的XML实体<代码>ü是HTML实体,而不是XML实体。

请参阅。问题又是甲骨文。 我无法在连接到internet的SGES 2.1.1上部署。当我关闭它时,部署很慢,但很成功。验证程序似乎试图刷新缓存的模式,并从schemaLocation URL下载它们

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
GET /xml/ns/javaee/web-app_2_5.xsd ... 
HTTP/1.1 301 Moved Permanently to Location: 
  http://download.oracle.com/javase/6/docs/technotes/guides/xml/index.html
但是没有这样的模式

我会努力找到一些好的解决办法,但最好的办法可能是在甲骨文公司给某人打电话


编辑:此时已修复(2010年1月27日,CET时间20:00),Oracle返回模式-您可以使用wget进行检查。浏览器被重定向到文档。Nice:-)

或编写自己的实体解析器,在本地查找这些实体

例如,在hibernate的情况下,以适当的方式指出模式位置就足够了: hibernate的
DTDEntityResolver

private static final String USER_NAMESPACE = "classpath://";
 ...
public InputSource resolveEntity(String publicId, String systemId) {
 ...
else if ( systemId.startsWith( USER_NAMESPACE ) ) {
...

对于eclipse,您可以在:首选项-->XML-->XML目录中指向本地xsd。

Andrew,恐怕您的命名空间不正确。我认为2.5版应该在javaee名称空间(JDK、Java1.5和1.6)下,而不是j2ee(J2SDK、Java1.4)下

因此,替换

http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd


@凯文:也许我遗漏了什么,但这个问题与地理有什么关系?@MichaelScheper-阅读完整的结束原因和公认的答案——“某个特定的时刻”。这是一个特定于一个非常短的时间内的问题,当时Oracle暂时破坏了承载Eclipse所依赖的各种XML模式的服务器。@Kev:这很公平。然而,我昨天也遇到了同样的问题,我发现这篇文章很有帮助。这表明存在网络连接问题,结果证明是正确的,尽管错误暗示存在格式问题。@Kev今天这里的问答帮助了我。这个问题仍然存在于其他以前的Sun Microsystems架构URL中,例如“死了?”???下一个域是什么???Oracle似乎再次删除了该文件(十年后)。尝试使用此选项:
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd