web-app_2_5.xsd在eclipse中validationweb.xml时显示错误

我不知道我能做些什么导致这种情况因为我花在编程上的时间已经延长了,而且我已经忘记了我可能做过的事情。 但现在当我加载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看起来是这样的。

   

我已经读过,对于从中检索文件的服务器或缓存,它可能是一个错误。 我已经禁用并清除了缓存,据我所知,除非他们切换到oracle.comurl并且我还没有找到它,否则其他人都在使用它。

任何想法将不胜感激。

请参阅http://www.reddit.com/r/programming/comments/f9sxu 。 问题是甲骨文。 我无法通过连接到互联网部署在SGES 2.1.1上。 当我关闭它时,部署很慢,但成功。 似乎validation器尝试刷新缓存的模式并从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 

但是没有这样的架构!

我会尝试找到一些好的解决方案,但最好的方法是在Oracle中打人…

编辑:此时已修复(2010年1月27日,欧洲中部时间20:00),Oracle返回架构 – 您可以使用wget进行检查。 浏览器被重定向到docs。 尼斯:-)

安德鲁,我担心你的命名空间不正确。 我认为版本2.5应该在javaee名称空间(JDK,Java 1.5和1.6)下,而不是j2ee(J2SDK,Java 1.4)。

所以更换

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

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

请看一下你的web.xml

是否有任何’&’标志,其中没有已知的XML实体? ü 是HTML实体, 而不是 XML-Entites。

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

以防万一,例如,hibernate,以适当的方式指向模式位置就足够了:hibernate的DTDEntityResolver摘录

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

在eclipse的情况下,您可以指向本地xsd:Preferences – > XML – > XML Catalog。