Eclipse web.xml“引用的文件包含错误”

问题描述 投票:0回答:1
"<?xml version="1.0" encoding="UTF-8"?>"

在这行中我遇到错误

描述资源路径位置类型 引用的文件包含错误(jar:file:/C:/Softwares/eclipse-jee-2023-09-R-win32-x86_64/eclipse/plugins/org.eclipse.jst.standard.schemas_1.2.600.v202307260543.jar!/ dtdsAndSchemas/jakartaee_10.xsd)。有关更多信息,请右键单击问题视图中的消息并选择“显示详细信息...

像这样。

完整的 Web.xml 文件是

请帮我解决这个问题

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="https://jakarta.ee/xml/ns/jakartaee"
    xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
    id="WebApp_ID" version="6.0">
    <display-name>Abc</display-name>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.jsp</welcome-file>
        <welcome-file>default.htm</welcome-file>
    </welcome-file-list>
</web-app>

Error here

eclipse servlets web.xml
1个回答
0
投票

我也有同样的错误。经过大量谷歌搜索、禁用验证、尝试更新 Eclipse(因为 XSD 包含在 Eclipse JAR 文件中)……解决方案很简单(回顾起来)。只需验证 web.xml 文件即可。 右键单击该文件并找到 Validate 选项。

验证完成后,“错误”消失。

我已经完成了Project > CleanMaven > Update并重新启动了Eclipse(对于其他“解决方案”,错误已恢复)并且错误消失了。

© www.soinside.com 2019 - 2024. All rights reserved.