参考Answer on multiple schemas 并遵循所有示例,这些示例在spring集成上下文文件中使用无版本模式引用。
在线一些模式似乎存在问题。例如:
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
引用http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
答案 0 :(得分:1)
不幸的是,由于历史原因,互联网上的一些无版本模式必须反映1.0模式,否则使用1.0.x版本的现有应用程序将失败;可能有用户仍在使用这些旧版本。
自1.0.4以来Spring Integration的版本从类路径访问正确的模式版本,因此这在运行时不是问题。
Spring感知IDE(例如STS,IDEA)知道Spring如何从类路径中解析出正确的模式。没有Spring插件的Eclipse没有,但您可以在首选项中设置模式映射,以将无版本模式映射到正确的模式。
我们有一个open JIRA issue可以为受此问题影响的模式添加评论。
对于给您带来的不便,我们深表歉意,但如果不打破旧应用,我们无能为力。我们只是不知道1.0.3上是否有生产应用程序。