Spring integration 无版本模式引用
关于 下面是所有示例,这些示例在spring集成上下文文件中使用无版本模式引用 一些在线模式似乎存在问题。例如:Spring integration 无版本模式引用,spring-integration,Spring Integration,关于 下面是所有示例,这些示例在spring集成上下文文件中使用无版本模式引用 一些在线模式似乎存在问题。例如: http://www.springframework.org/schema/integration/spring-integration.xsd 不同于: http://www.springframework.org/schema/integration/spring-integration-4.2.xsd 在撰写本文时,这是最新版本。现在,在运行应用程序时,这不会导致任何问题,但
http://www.springframework.org/schema/integration/spring-integration.xsd
不同于:
http://www.springframework.org/schema/integration/spring-integration-4.2.xsd
在撰写本文时,这是最新版本。现在,在运行应用程序时,这不会导致任何问题,但eclipse会抱怨很多属性。为了修复它,我只需强制引用版本4.2
那么,模式有什么问题吗
还是我做错了?以下是模式引用之前和之后的内容:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/mail http://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd">
之后:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-file="http://www.springframework.org/schema/integration/file"
xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:int-stream="http://www.springframework.org/schema/integration/stream"
xsi:schemaLocation="
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration-4.2.xsd
http://www.springframework.org/schema/integration/mail http://www.springframework.org/schema/integration/mail/spring-integration-mail-4.2.xsd
http://www.springframework.org/schema/integration/file http://www.springframework.org/schema/integration/file/spring-integration-file-4.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/integration/stream
http://www.springframework.org/schema/integration/stream/spring-integration-stream-4.2.xsd">
除此之外:
http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd
referenceshttp://www.springframework.org/schema/integration/spring-integration-1.0.xsd
不幸的是,由于历史原因,internet上的一些无版本模式必须反映1.0模式,否则,使用1.0.x版本的现有应用程序将失败;可能有用户仍在使用这些旧版本
自1.0.4以来的Spring集成版本从类路径访问正确的模式版本,因此在运行时这不是问题
支持Spring的IDE(如STS、IDEA)知道Spring如何从类路径解析正确的模式。没有Spring插件的Eclipse不会,但是您可以在首选项中设置模式映射,以将无版本模式映射到正确的模式
我们需要向受此问题影响的模式添加一条注释
对于给您带来的不便,我们深表歉意,但如果不破坏旧的应用程序,我们将无能为力。我们只是不知道1.0.3版上是否有生产应用程序。谢谢Gary,解释得很好