web.xml错误
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
findbug运行后 报以下错误:
1)Description Resource Path Location Type Error - schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. web.xml ETP/WebContent/WEB-INF line 1 XML Auto-Validate
2)Description Resource Path Location Type Error - cvc-elt.1: Cannot find the declaration of element 'web-app'. web.xml ETP/WebContent/WEB-INF line 5 XML Auto-Validate

解决方案 »

  1.   

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
                             "http://java.sun.com/dtd/web-app_2_3.dtd">
    换这个试试
      

  2.   

    别乱给建议,这个换了就错大了。
    那个错误错误是因为没有找到合适的dtd文件。实际上没关系,可以正常启动。
      

  3.   

    应该是Eclipse的问题,同一个项目,别人不报这个错,而我的却报
      

  4.   

    你可去google下看看。
    或者去官网看看。
    一般来说,dtd文件都应该是cache到本地的。直接输入:http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd这样的url,应该是可以得到文件的。
    findBug怎么查找本地路径中的dtd,如何认定错误,我不太明白。
      

  5.   

    感觉是Eclipse的哪地方不对,咋别人就不报错呢