java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter


In Hibernate development, it’s common to hits the following error message.

SEVERE: Context initialization failed
Error creating bean with name 'sessionFactory' defined in ServletContext resource 
Invocation of init method failed; nested exception is 
Caused by: org.hibernate.HibernateException: 
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
	at net.sf.cglib.core.DebuggingClassWriter.<init>(


The “Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer” is a generic error message, it may caused by many reasons. So, you have to look at the last line that caused the error.

Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter

The main cause is the old asm.jar library e.g ‘asm-1.5.3.jar’, just upgrade the asm library to the most recent version will get rid of the error message. e.g, ‘asm-3.1.jar’.


  1. ASM library offcial website
Tags :

About the Author

Founder of and, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.


  • Pingback: this post()

  • Pingback: click this()

  • Pingback: loan payment plan()

  • Pingback: cheap car insurance()

  • Pingback: pay per day loan plans()

  • Pingback: HD Coloring Pages()

  • Pingback: house blue()

  • Pingback: bottled alkaline water()

  • Pingback: plumber in my area chicago()

  • Pingback: fitting plumbing pvc copper book()

  • Pingback: paypal loans()

  • Pingback: water ionizer plans()

  • Pingback: laan penge()

  • Pingback: water ionizer()

  • Pingback: laan penge online()

  • Pingback: 3gp mobile porn()

  • Pingback: stop parking()

  • Pingback: parking()

  • Pingback: tv packages()

  • Pingback:

  • Pingback: kangen water()

  • Pingback: alkaline water benefits()

  • Pingback: water purification systems()

  • Pingback: water ionizer()

  • Pingback: stream movies()

  • Pingback: tv online, online tv()

  • Pingback: watch free movies online()

  • Pingback: tv online, online tv()

  • Pingback: Watch Video()

  • Pingback: Blue Coaster33()

  • Leonel

    Me salvaste la vida, gracias !!

  • Sam

    tried with:




    still getting:

    Initial SessionFactory creation org.objectweb.asm.ClassWriter.(I)V
    Exception in thread “main” java.lang.ExceptionInInitializerError
    at com.mkyong.persistence.HibernateUtil.buildSessionFactory(
    at com.mkyong.persistence.HibernateUtil.(
    at com.mkyong.common.App.main(
    Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(I)V
    at net.sf.cglib.core.DebuggingClassWriter.(
    at net.sf.cglib.core.DefaultGeneratorStrategy.getClassWriter(
    at net.sf.cglib.core.DefaultGeneratorStrategy.generate(
    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.core.KeyFactory.create(
    at net.sf.cglib.proxy.Enhancer.(
    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.getProxyFactory(
    at org.hibernate.proxy.pojo.cglib.CGLIBProxyFactory.postInstantiate(
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.(
    at org.hibernate.tuple.entity.PojoEntityTuplizer.(
    at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(
    at org.hibernate.tuple.entity.EntityMetamodel.(
    at org.hibernate.persister.entity.AbstractEntityPersister.(
    at org.hibernate.persister.entity.SingleTableEntityPersister.(
    at org.hibernate.persister.PersisterFactory.createClassPersister(
    at org.hibernate.impl.SessionFactoryImpl.(
    at org.hibernate.cfg.Configuration.buildSessionFactory(
    at com.mkyong.persistence.HibernateUtil.buildSessionFactory(
    … 2 more

  • Mushthaq

    I’m using Hibernate with Restful web services. It gives me the above error. But when I tried to change the ASM version, the Jersey is not working. How can I solve this issue

    Hoping for a kind response.
    Thank you

  • GHAFFARI El Mehdi

    thank you so much, was hitting the wall, but now it’s got solved ;)

  • fsaldivars

    if it’s happen on Glassfish V2.2…
    you cant try it.
    if page it´s no available:

    The simple solution is to manually delete the “asm-3.1.jar” file in the /lib/ directory and copy an old version of “asm-.jar” in its place. We simply copied the asm.jar that was included as a dependency in our download of the Hibernate framework.

    • mkyong

      Thanks for your inputs on Glassfish.

  • Mon

    Thank you!

  • lightstar41


  • Ademir

    Awesomeeeeee it really works!! Thanx a lot!!

  • Duminda

    Great it worked for me!
    particularly the advice..

    The “Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer” is a generic error message, it may caused by many reasons. So, you have to look at the last line that caused the error.

    So looked at the last cause by which said…

    Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for person in class springapp.domain.Schooldetails

    (but when the source file was checked the propery did exist!!! What’s going on here. I was using hibernate tools from jboss and thought may be there’s some sort of class caching going around and rebuilt the whole project and walla!.. it worked.)

  • Ibrahim Mustafa

    Thanks for the solution. You saved my day.

  • Christopher

    Thanks, that’s it :)

  • Pingback: Hibernate Tutorials()