gpt4 book ai didi

spring - 为什么 Spring XSD 会出现 DTD 错误 "White spaces are required between publicId and systemI"

转载 作者:行者123 更新时间:2023-12-04 18:24:35 31 4
gpt4 key购买 nike

在我的应用程序上下文文件中,Eclipse 显示错误:

引用的文件包含错误 ( http://www.springframework.org/schema/integration )。 applicationContext.xml 第 1 行 XML 问题

查看 Eclipse 中的错误详细信息,我看到:

            White spaces are required between publicId and systemId

根据遇到此问题的其他人的说法,它与显然必须具有 SYSTEM 标识符的 DOCTYPE 有关。

为什么在 2014 年 DOCTYPE 已经过时了,因为我们都使用 XSD 而不是 DTD,而且 http://www.springframework.org/schema/integration 中没有 DOCTYPE (或应该有)是否发生此错误?

          <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:mail="http://www.springframework.org/schema/integration/mail"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/integration/mail
http://www.springframework.org/schema/integration/mail/spring-integration-mail-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-3.0.xsd
http://www.springframework.org/schema/context/spring-context.xsd">

谢谢

最佳答案

你必须将 spring-context.xsd 移动到它的 id:

<beans 
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration-3.0.xsd">

关于spring - 为什么 Spring XSD 会出现 DTD 错误 "White spaces are required between publicId and systemI",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22386617/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com