Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

new Enhancer() Caused by: java.lang.IllegalArgumentException

See original GitHub issue

hi , I use cglib 3.2.7 ,when I new Enhancer(),throw IllegalArgumentException

Enhancer enhancer = new Enhancer();

	at com.mario.AnnotationProcessor.MarioProxyUtil.create(
	at userTransaction.hotel.searchAPI.testsuites.NEWTest.test(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at org.junit.runners.ParentRunner.runLeaf(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.ParentRunner$
	at org.junit.runners.ParentRunner$1.schedule(
	at org.junit.runners.ParentRunner.runChildren(
	at org.junit.runners.ParentRunner.access$000(
	at org.junit.runners.ParentRunner$2.evaluate(
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(
	at com.intellij.rt.execution.junit.JUnitStarter.main(
Caused by: java.lang.IllegalArgumentException
	at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
	at net.sf.cglib.core.DebuggingClassWriter.<init>(
	at net.sf.cglib.core.DefaultGeneratorStrategy.getClassVisitor(
	at net.sf.cglib.core.DefaultGeneratorStrategy.generate(
	at net.sf.cglib.core.AbstractClassGenerator.generate(
	at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(
	at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(
	at net.sf.cglib.core.internal.LoadingCache$
	at net.sf.cglib.core.internal.LoadingCache.createEntry(
	at net.sf.cglib.core.internal.LoadingCache.get(
	at net.sf.cglib.core.AbstractClassGenerator$ClassLoaderData.get(
	at net.sf.cglib.core.AbstractClassGenerator.create(
	at net.sf.cglib.core.KeyFactory$Generator.create(
	at net.sf.cglib.core.KeyFactory.create(
	at net.sf.cglib.core.KeyFactory.create(
	at net.sf.cglib.proxy.Enhancer.<clinit>(

java version 1.8.0_144, maven version Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

zhoujiangyoucommented, Jul 8, 2020

Same problem. Any progress?

Encounter the same problem, fixed by change the version of asm, so maybe wrong asm version was used in you project.

awesome! save me lots of time!

so … which version can solve ?

conhaifengcommented, Aug 6, 2019

Same problem. Any progress?

Encounter the same problem, fixed by change the version of asm, so maybe wrong asm version was used in you project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cglib throws an IllegalArgumentException when enhancing ...
It seems like your are using a JDK in version 8 which includes class files in version 8. These class files are not...
Read more >
Enhancer - Spring
Object, create(). Generate a new class if necessary and uses the specified callbacks (if any) to create a new object instance. java.lang.
Read more >
Mvn commands is not working - M220J - MongoDB
Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.reflect.InaccessibleObjectException–>Unable to make protected final ...
Read more >
[Play-1.2.4] An unexpected error occured caused by exception ...
While applying class play.classloading.enhancers.ContinuationEnhancer ... Caused by: java.lang.IllegalArgumentException: Invalid operand (must
Read more >
[Solved] java.lang.IncompatibleClassChangeError
This error is due to an incompatible version of cglib with additional jar files in your project, such as asm. Random exceptions ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found