Main Tutorials

java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V

Problem

Ant project, doing Spring + Hibernate (annotation) development, but hits following error message :


Caused by: java.lang.NoSuchMethodError: 
		org.objectweb.asm.ClassWriter.<init>(Z)V

Here’s the list of the main jar files, included asm-3.3.1.jar, but still hits the above error message?

  1. hibernate-3.2.7.ga.jar
  2. hibernate-annotations-3.4.0.GA.jar
  3. hibernate-commons-annotations-3.0.0.GA.jar
  4. spring-2.5.6.jar
  5. asm-3.3.1.jar

Solution

A classic problem in Ant project, you have to manage dependency library manually, use Maven, next time :). The asm.3.3.1.jar is rather new, some methods are removed and causing the NoSuchMethodError error message.

To fix it, try downgrade asm jar to older version, for example, asm3.1.jar, this is my favor version.

Reference

  1. http://forge.ow2.org/projects/asm/

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
8 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Hayk
11 years ago

asm-3.1.jar didn’t help me, but as downloaded asm-1.5.3.jar and error was solved. thanks for hint. but don’t forget to remove old asm jars like asm-3.1.jar

jillu kumar swain
7 years ago

java.lang.NoSuchMethodError: jxl.WorkbookSettings.setUseTemporaryFileDuringWrite(Z)V ??

siva
10 years ago

Hi Mykong,
I upgraded asm1.5. jar to asm3.5. Now I’m getting the following exception.java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter.

Hayk
11 years ago

asm-3.1.jar didn’t help me, but as downloaded asm-3.5.3.jar and error was solved. thanks for hint.

karam
10 years ago
Reply to  Hayk

i download asm-1.5.3.jar and the error was solved.thanks

Shimray
11 years ago
Reply to  Hayk

Phew!!!!! this solved my problem too. Thanks to your comment and thanks to Mkyong. Very helpful site.

anushree
11 years ago

I have added asm3.0 and asm3.1

still i am getting the error:(

White_King
12 years ago

if u r deploying on GlassFish just delete de library asm

http://javahelp.redasaltillo.net