Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Eclipse web.xml引用文件错误_Java_Eclipse - Fatal编程技术网

Java Eclipse web.xml引用文件错误

Java Eclipse web.xml引用文件错误,java,eclipse,Java,Eclipse,我在eclipse中导入了一个项目作为maven项目——我将web应用程序版本从2.5升级到3.1,因为它作为动态web模块3.1导入。现在我得到以下错误: 通过文件“web.xml”验证文件“web-app_3_1.xsd”时检测到以下错误。在大多数情况下,可以通过直接验证“web-app_3_1.xsd”来检测这些错误。但是,只有在web.xml上下文中验证web-app_3_1.xsd时,才可能发生错误 s4s elt字符:除xs:appinfo和xs:documentation之外,架构

我在eclipse中导入了一个项目作为maven项目——我将web应用程序版本从2.5升级到3.1,因为它作为动态web模块3.1导入。现在我得到以下错误:

通过文件“web.xml”验证文件“web-app_3_1.xsd”时检测到以下错误。在大多数情况下,可以通过直接验证“web-app_3_1.xsd”来检测这些错误。但是,只有在web.xml上下文中验证web-app_3_1.xsd时,才可能发生错误

s4s elt字符:除xs:appinfo和xs:documentation之外,架构元素中不允许使用非空白字符。Saw'var\U=“未定义”;'

相关问题:

  • 上面关于SO的两个问题指向同一个问题,答案表明名称空间应该是javaee,事实已经如此:

    <web-app version="3.1" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd">
    

    在你的web.xml中试试这个,注意
    xmlns
    指向
    http://xmlns.jcp.org

    <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
             http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
             version="3.1">
    
    
    
    尝试从org.eclipse.wst.common.project.facet.core.xml中删除web模块条目保存文件,转到“project Facets”并将其更改为动态web模块版本3.1