Eclipse语言服务器:“javaee_7.xsd”中存在“% 1”错误

w7t8yxp5  于 5个月前  发布在  Eclipse
关注(0)|答案(1)|浏览(83)

当我在Eclipse Enterprise版本中创建动态Web项目时尝试自动生成web.xml文件时,它显示了一个类型为“Language Servers”的错误。它将web.xml文件的此元素指示为错误:

<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_4_0.xsd"
    version="4.0"
>

字符串
x1c 0d1x的数据

  • “javaee_7.xsd”中存在“% 1”错误。
  • schema_reference.4:无法读取架构文档“platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml. xsd”,因为1)找不到文档; 2)无法读取文档; 3)文档的根元素不是xsd:schema。
gcxthw6b

gcxthw6b1#

这是Eclipse中的一个漏洞,自2021-03年以来一直存在。
它在这里被分解:https://github.com/eclipse/lemminx/issues/1042#issuecomment-859778034:
好吧,我可以用一个新的Eclipse IDE重现这个问题(最后一个)。我可以解释这个问题,但我不知道如何修复它(目前)。
当你有"There is '1' error in 'jakartaee_9.xsd'"错误,你必须打开XSD文件(从该高速缓存),你应该看到1个错误和1个警告:
x1c 0d1x的数据
有一个警告:

schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.  jakartaee_9.xsd /lemminx-cache/https/jakarta.ee/xml/ns/jakartaee    line 52 Language Servers

字符串



它试图在xml.xsd文件中定义xml:lang属性。但是在这里无法检索xml.xsd(警告消息),并且您会遇到错误:



它试图从platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd下载XSD,但平台是特定于Eclipse IDE的。换句话说,当必须解析http://www.w3.org/2001/xml.xsd时,它说platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd是XSD的位置。我不知道是谁做的?
我的印象是LemMinx被配置为使用WTP的XML目录:



在等待Eclipse版本的修复(在撰写本文时确实尚未发布)时,一个解决方案是禁用LemMinx验证:
@chris21k请注意,您可以禁用LemMinx验证:
x1c4d 1x的

相关问题