Reputation: 4088
I followed the advice given here to try some unit tests with spring aop enabled methods. However, I suspect that the repackaged cglib classes under spring-core and the cglib-nodep-2.2.jar conflict with each other, causing my class being proxied to be loaded by the classloader twice. This results in the following error:
Caused by: java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name:
Tools:
Excluding the transitive cglib-nodep dependency didn't help obviously - all tests including non-sring-aop ones started failing too.
I tried the answer posted here too: cleaning up the target folder before running the tests again with no success.
Is this problem really because of the conflict of cglib versions like I thought it would be? If so, what is the right version I should use that would stop loading my class twice.
Upvotes: 0
Views: 777
Reputation: 1
<properties>
<java.version>1.7</java.version>
<spring.version>4.0.3.RELEASE</spring.version>
<cglib.version>2.2.2</cglib.version>
</properties>
Upvotes: 0