Spring 3.2.12 looking for Spring 4.0 classes?

1.5k views Asked by At

I have an application that currently compiles correctly with Spring 3.2.3. Wanting to be more currently (but not ready to take the plunge to 4.x yet) I tried upgrading to 3.2.12. When I go that, I get a curious compilation error from 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]

I think I understand the logic here, but why is Spring 3.2.12 referring to Spring 4.x interfaces? And how do I even find the subclasses that is causing the troubles? This is happening even in projects that currently don't have any pointcuts at all.

2

There are 2 answers

2
rlm On

If you use maven try to use a dependency:tree to find which lib import the Spring 4 libs.

And then try to use exlusions tag to exlude this artifact from import when maven compiles. You may have a conflict on libraries.

0
madx On

I found a simple workaround:

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

For more info read this JCache dependency in spring-aspects