The moose likes Object Relational Mapping and the fly likes java.lang.NoSuchMethodError Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of C++ Concurrency this week in the C/C++ forum
or Spring Integration in Action in the Spring forum!
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "java.lang.NoSuchMethodError" Watch "java.lang.NoSuchMethodError" New topic
Author

java.lang.NoSuchMethodError

Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 78
Hi
I have configured my Hibernate with the required files but wen i am trying to execute the Client program I am facing the below issue. I am using the cglib-2.2_beta1.jar file which looks like the latest jar.

Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
at net.sf.cglib.core.DebuggingClassWriter.<init>(DebuggingClassWriter.java:47)
at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(DefaultGeneratorStrategy.java:30)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:24)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:308)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at FirstHibernate.FirstExample.main(FirstExample.java:14)

My Client program is as follows :

regards
Prashanth

This message was edited 1 time. Last update was at by Vijitha Kumara

Abhi Vuyyuru
Greenhorn

Joined: Mar 10, 2005
Posts: 12
The class org.objectweb.asm.ClassWriter is in asm.jar file. Please check if the version it you have the correct version of the file.

Also, there was a similar problem with using cglib2.0, you may want to try switching to an older version instead of the beta.


Abhi Vuyyuru
Blog: http://java-x.blogspot.com
Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 78
Hi
I am using cglib-2.2_beta1.jar and asm-3.0_RC1 files which seems to be the latest jar files. But still I am facing the same issue.



regards
Prashanth
sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 119
Hi
place asm.jar,asm-attrs.jar instead of asm-3.0.jar files.
Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 78
Hi
We have many versions of asm and asm-attrs I have tried placing some versions but still it does not work. Can you please let me know which version of jar needs to put.



regards
Prashanth
sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 119
provide me your mail id.so that i can send you jar files
Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 78
Hi
Please send me the jar files to shanthchandra@gmail.com

Thanks in advance

regards
Prashanth
sreenivas jeenor
Ranch Hand

Joined: Jan 09, 2005
Posts: 119
sent the jar files.Hope this will help you
Prashanth Chandra
Ranch Hand

Joined: Dec 07, 2005
Posts: 78
Hi
Thanks for the jar files you have sent me. But I am facing some more issues when I have put these jar files. Please find the error below.


Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String V
at net.sf.cglib.core.ClassEmitter.begin_class(ClassEmitter.java:77)
at net.sf.cglib.core.KeyFactory$Generator.generateClass(KeyFactory.java:172)
at net.sf.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:216)
at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:144)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:116)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:308)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at FirstHibernate.FirstExample.main(FirstExample.java:14)


Thanks in advance
regards
Prashanth
Mahesh G P
Greenhorn

Joined: Apr 20, 2008
Posts: 6
This problem is resolved for me when i have changed from cglib jar 2.2 to 2.1.
Amol Wani
Greenhorn

Joined: Jul 26, 2010
Posts: 1
Please use "cglib-2.1.3.jar" and "asm-1.5.1.jar", you will not get this sort of exception.
Obed Vazquez
Greenhorn

Joined: Jan 26, 2012
Posts: 1
if you are using glassfish just delete the labrary asm

This message was edited 1 time. Last update was at by Bear Bibeault

Aj Maven
Greenhorn

Joined: Jul 04, 2011
Posts: 17

Amol wani's suggestion worked perfectly, to solve this issue. Thanks a lot.


Thanks
-Aj
 
 
subject: java.lang.NoSuchMethodError
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture