WEB-XML 文件显示错误 Javaee_7.xsd 错误

问题描述

enter image description hereweb-xml 是在创建动态 web 项目时自动创建的,但显示错误请建议

'<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">

解决方法

您缺少结束标记

<?xml version="1.0" encoding="UTF-8"?>
<web-app 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
  xmlns="http://xmlns.jcp.org/xml/ns/javaee"  
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" 
  id="WebApp_ID" version="3.1">
</web-app>
,

听起来像是语言服务器的问题。检查问题视图以了解它报告的问题类型,因为这听起来就像 https://github.com/eclipse/lemminx/issues/1042(因为默认文件内容在历史上没有导致验证错误,因为它们是正确的)。