Forums Register Login

java.lang.NoSuchMethodError

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
1
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Hi
place asm.jar,asm-attrs.jar instead of asm-3.0.jar files.
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
provide me your mail id.so that i can send you jar files
+Pie Number of slices to send: Send
Hi
Please send me the jar files to shanthchandra@gmail.com

Thanks in advance

regards
Prashanth
+Pie Number of slices to send: Send
sent the jar files.Hope this will help you
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
This problem is resolved for me when i have changed from cglib jar 2.2 to 2.1.
2
+Pie Number of slices to send: Send
Please use "cglib-2.1.3.jar" and "asm-1.5.1.jar", you will not get this sort of exception.
+Pie Number of slices to send: Send
if you are using glassfish just delete the labrary asm
+Pie Number of slices to send: Send
Amol wani's suggestion worked perfectly, to solve this issue. Thanks a lot.
+Pie Number of slices to send: Send
Amol Wani's reply worked perfectly without any issues.Thanks a lot
1
+Pie Number of slices to send: Send
If still someone facing issue, please try cglib-nopep-2.1_3.jar instead of cglib-2.1_3.jar. So my combination is cglib-nopep-2.1_3.jar, hibernate-3.2.6.ga.jar and asm-1.5.3, I tried so many combinations on Websphere 8.5. And finally it worked.
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 58204 times.
Similar Threads
Trouble to run a simple Hibernate /JPA CRUD sample
ProxyFactory initialization error - Spring 1.2.1
Can't connect to MySQL database with Hibernate
CGLib error in "Before Advice" case
java.lang.IllegalAccessError
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:41:31.