Eclipse web.xml引用文件错误 [英] Eclipse web.xml Referenced File Error

查看:1051
本文介绍了Eclipse web.xml引用文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中导入了一个项目作为maven项目 - 我将web-app版本从2.5升级到3.1,因为它已作为Dynamic web Module 3.1导入。现在我收到以下错误:

I imported a project in eclipse as maven project - I upgraded the web-app versions from 2.5 to 3.1 because it got imported as Dynamic web Module 3.1. Now I am getting the following error :


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

The errors below were detected when validating the file "web-app_3_1.xsd" via the file "web.xml". In most cases these errors can be detected by validating "web-app_3_1.xsd" directly. However it is possible that errors will only occur when web-app_3_1.xsd is validated in the context of web.xml.

s4s-elt-character:非空白字符除xs:appinfo和xs:documentation之外的架构元素中不允许使用。看到'var _U =undefined;'

s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than xs:appinfo and xs:documentation. Saw 'var _U="undefined";'

相关问题:


  1. 问题1

  2. 问题2

  1. Question1
  2. Question2

关于SO的2个问题指向同一个问题,答案表明命名空间应该是javaee,已经是这样了:

Above 2 questions on SO point to the same issue and the answers suggests that the namespace should be javaee, which is already the case:

<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

Try this in your web.xml, note that xmlns points to 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中删除web模块条目。 xml保存文件,转到Project Facets并将其更改为Dynamic Web Module Version 3.1。

Try removing the web module entry from org.eclipse.wst.common.project.facet.core.xml save the file, Go to 'Project Facets' and change it to Dynamic Web Module Version 3.1.

示例

这篇关于Eclipse web.xml引用文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆