【发布时间】:2014-08-02 13:36:25
【问题描述】:
我的 lib 文件夹中有 4.0.4 版本的 spring jar。在applicationContext.xml 中,我使用了 3.0 版本的架构。
例如: 我有以下罐子:
- spring-beans-4.0.4
- spring-context-4.0.4
- spring-core-4.0.4
- spring-expression-4.0.4
- sprig-web-4.0.4
- spring-webmvc-4.0.4
我在 applicationContext.xml 中写道:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
我的问题是:
schema 和 jar 之间是否可能有不同的版本?
如果是,有什么后果?
【问题讨论】:
-
是的。有时它会引发错误。所以尝试使用相同版本的 jars,并在 xml 中使用通用模式而不是基于版本。