net.sf.cglib.core.CodeGenerationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • In 3.2 GA version of the Spring Framework I started to experience LingageErrors with cause of duplicate class definition. For example: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:64) at net.sf.cglib.proxy.MethodProxy.helper(MethodProxy.java:120) at net.sf.cglib.proxy.MethodProxy.init(MethodProxy.java:74) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:213) at com.fg.metadata.business.aop.SpringCgLibIssue$AbstractMethodInterceptor.intercept(SpringCgLibIssue.java:58) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$EnhancerByCGLIB$$f3b6125d.getSomeInt(<generated>) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$FastClassByCGLIB$$4b5eb31.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at com.fg.metadata.business.aop.SpringCgLibIssue$SomeAdvice.invoke(SpringCgLibIssue.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$EnhancerByCGLIB$$d3d37a7d.getSomeInt(<generated>) at com.fg.metadata.business.aop.SpringCgLibIssue.testCallMethodOfAbstractClass(SpringCgLibIssue.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139) at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 36 more Caused by: java.lang.LinkageError: duplicate class definition: com/fg/metadata/business/aop/SpringCgLibIssue$TestClassToProxy$$FastClassByCGLIB$$4b5eb31 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) ... 42 more Problem can be reproduced by the attached TestCase. Problem is quite weird - and is described in the attached test. Only first call to the implemented method of the abstract class ends with this exception, all succeeding calls finish ok. Please don't ask why we are wrapping CgLib proxy into another Spring proxy. We have our reasons that are quite complex to explain. This problem did not occur in previous versions of Spring (we use this mechanism since 2.5 version of Spring). Thanks for help in advance.
    via by Jan Novotný,
  • In 3.2 GA version of the Spring Framework I started to experience LingageErrors with cause of duplicate class definition. For example: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:64) at net.sf.cglib.proxy.MethodProxy.helper(MethodProxy.java:120) at net.sf.cglib.proxy.MethodProxy.init(MethodProxy.java:74) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:213) at com.fg.metadata.business.aop.SpringCgLibIssue$AbstractMethodInterceptor.intercept(SpringCgLibIssue.java:58) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$EnhancerByCGLIB$$f3b6125d.getSomeInt(<generated>) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$FastClassByCGLIB$$4b5eb31.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at com.fg.metadata.business.aop.SpringCgLibIssue$SomeAdvice.invoke(SpringCgLibIssue.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$EnhancerByCGLIB$$d3d37a7d.getSomeInt(<generated>) at com.fg.metadata.business.aop.SpringCgLibIssue.testCallMethodOfAbstractClass(SpringCgLibIssue.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139) at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 36 more Caused by: java.lang.LinkageError: duplicate class definition: com/fg/metadata/business/aop/SpringCgLibIssue$TestClassToProxy$$FastClassByCGLIB$$4b5eb31 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) ... 42 more Problem can be reproduced by the attached TestCase. Problem is quite weird - and is described in the attached test. Only first call to the implemented method of the abstract class ends with this exception, all succeeding calls finish ok. Please don't ask why we are wrapping CgLib proxy into another Spring proxy. We have our reasons that are quite complex to explain. This problem did not occur in previous versions of Spring (we use this mechanism since 2.5 version of Spring). Thanks for help in advance.
    via by Jan Novotný,
  • Start Glassfish 4.0 with Error
    via Stack Overflow by javagc
    ,
  • db:: 5.36::JaxB error x9
    via by Unknown author,
    • net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:237) at net.sf.cglib.reflect.FastClass$Generator.create(FastClass.java:64) at net.sf.cglib.proxy.MethodProxy.helper(MethodProxy.java:120) at net.sf.cglib.proxy.MethodProxy.init(MethodProxy.java:74) at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:213) at com.fg.metadata.business.aop.SpringCgLibIssue$AbstractMethodInterceptor.intercept(SpringCgLibIssue.java:58) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$EnhancerByCGLIB$$f3b6125d.getSomeInt(<generated>) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$FastClassByCGLIB$$4b5eb31.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at com.fg.metadata.business.aop.SpringCgLibIssue$SomeAdvice.invoke(SpringCgLibIssue.java:71) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631) at com.fg.metadata.business.aop.SpringCgLibIssue$TestClassToProxy$$EnhancerByCGLIB$$d3d37a7d.getSomeInt(<generated>) at com.fg.metadata.business.aop.SpringCgLibIssue.testCallMethodOfAbstractClass(SpringCgLibIssue.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:139) at com.intellij.junit3.JUnit3IdeaTestRunner.startRunnerWithArgs(JUnit3IdeaTestRunner.java:52) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:384) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) ... 26 more Caused by: java.lang.LinkageError: duplicate class definition: com/fg/metadata/business/aop/SpringCgLibIssue$TestClassToProxy$$FastClassByCGLIB$$4b5eb31 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) ... 31 more

    Users with the same issue

    derprogger
    4 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    38 more bugmates