attempted duplicate class definition

130 views
Skip to first unread message

Keir Lawson

unread,
Dec 23, 2013, 10:01:23 AM12/23/13
to spockfr...@googlegroups.com
Hello,

I'm getting a slightly odd problem when trying to run a suite of Spock (0.7) tests.  One of my tests is failing with the error below

org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
    at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237)
    at org.springframework.cglib.reflect.FastClass$Generator.create(FastClass.java:64)
    at org.springframework.cglib.proxy.MethodProxy.helper(MethodProxy.java:121)
    at org.springframework.cglib.proxy.MethodProxy.init(MethodProxy.java:74)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:202)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:713)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:646)
    at my.project.MyServiceSpec.get list of request types(MyServiceSpec.groovy:40)
Caused by: java.lang.reflect.InvocationTargetException
    at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384)
    at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219)
    ... 12 more
Caused by: java.lang.LinkageError: loader (instance of  sun/misc/Launcher$AppClassLoader): attempted  duplicate class definition for name: "my/project/service/MyService$$FastClassByCGLIB$$747581e9"
    ... 14 more

However when I run this test in isolation or as the first test or several it passes just fine, anyone have any idea what the issue could be?

Thanks

Keir
Reply all
Reply to author
Forward
0 new messages