0

我有一个当前可以使用 Spring 3.2.3 正确编译的应用程序。想要更多当前(但还没有准备好跳入 4.x)我尝试升级到 3.2.12。当我这样做时,我从 aspectj 得到一个奇怪的编译错误:

[INFO] --- aspectj-maven-plugin:1.3:compile (default) @ ebs-schema-jaxb-bindings ---
[ERROR] can't determine superclass of missing type org.springframework.cache.interceptor.CacheAspectSupport when batch building BuildConfig[null] #Files=3825 AopXmls=#0
[Xlint:cantFindType]
[ERROR] can't determine superclass of missing type org.springframework.aop.interceptor.AsyncExecutionAspectSupport when batch building BuildConfig[null] #Files=3825 AopXmls=#0
[Xlint:cantFindType]

我想我理解这里的逻辑,但是为什么 Spring 3.2.12 指的是 Spring 4.x 接口?以及如何找到导致麻烦的子类?即使在目前根本没有任何切入点的项目中也会发生这种情况。

4

2 回答 2

3

如果您使用 maven,请尝试使用依赖项:树来查找导入 Spring 4 库的库。

然后尝试在 maven 编译时使用 exlusions 标签将这个工件排除在导入之外。您可能对库有冲突。

于 2014-11-14T16:46:53.797 回答
0

我找到了一个简单的解决方法:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>${spring.version</version>
</dependency>
<dependency>
    <groupId>javax.cache</groupId>
    <artifactId>cache-api</artifactId>
    <version>1.0.0</version>
</dependency>

有关更多信息,请阅读spring-aspects 中的此 JCache 依赖项

于 2015-09-22T18:12:33.053 回答