为什么 Spring XSD "White spaces are required between publicId and systemI"会发生 DTD 错误



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

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

查看Eclipse中的错误细节,我看到:

            White spaces are required between publicId and systemId

根据其他有此问题的人,它与Doctype有关,显然必须具有系统标识符。

为什么在2014年,当Doctype's已过时,因为我们所有人都使用XSD而不是DTD,而http://www.springframework.org/schema/schema/integration/Integration(或应该发生)此错误会发生吗?

          <?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">

最新更新