0

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.

Community
  • 1
  • 1
Steve
  • 692
  • 1
  • 7
  • 18
  • 1
    Please post the output of `dependency:tree`. Most likely, you're getting a transitive dependency pulled in. – chrylis -cautiouslyoptimistic- Nov 14 '14 at 16:48
  • Looking at my dependency tree, I don't see any Spring 4.x pulled in. The only change was to replace 3.2.3-RELEASE with 3.2.12-RELEASE for the spring libs. – Steve Nov 14 '14 at 17:05
  • 1
    I highly doubt spring 3.2.12 is referencing Spring 4.0 interfaces. I suspect it is due to wrong aspectj dependencies and the use of an ancient `aspects-maven-plugin` (1.3 is from 2010 1.7 is the most recent version). Also make sure that all your 3.2 jars are from 3.2.12 and not mixing different versions of 3.2.x. Finally make sure you have `spring-context` and `spring-aop` in your classpath for that specific project. – M. Deinum Nov 14 '14 at 20:49
  • 2
    Post your pom.xml or the dependency tree. Seeing is believing. You do not expect anyone to waste their time based on promises made by the very person seeking help because he does not know how to help himself, do you? This is StackOverflow, not a quiz show. – kriegaex Nov 14 '14 at 23:18
  • I'm sorry - I'm not trying to 'play quiz' show with anybody. I'm not sure what to post here ... posting the actual pom is complicated because it is multiple levels of parents. When I try to print the dependency tree I get a stack trace. All I am doing is changing one variable: 3.2.3.RELEASE WORKS 3.2.12.RELEASE BREAKS That variable is used only for these dependencies: spring-core -test -oxm -beans -web -context -aop -aspects -tx -webmvc -jdbc – Steve Nov 17 '14 at 14:40

2 Answers2

3

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.

rlm
  • 162
  • 7
  • the dependency:tree is a good suggestion to find the issue, but this is not a agood answer because doesn't give the user a solution to the problem... please post it as a comment – fmodos Nov 14 '14 at 16:48
  • As mentioned above, there are no Spring4 libs being pulled in. Everything is 3.2.12-RELEASE. – Steve Nov 14 '14 at 17:59
0

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

madx
  • 6,723
  • 4
  • 55
  • 59