org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

This Exception during the maven build in an hibernate based project could come due to various reasons.
Primarily one should look into the complete stack trace. The further exception usually do give clue of the actual problem.

I my case, the stack trace revealed the below issue
Exception in thread "main" org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.(EntityEntityModeToTuplizerMapping.java:80)
at org.hibernate.tuple.entity.EntityMetamodel.(EntityMetamodel.java:323)
at org.hibernate.persister.entity.AbstractEntityPersister.(AbstractEntityPersister.java:456)
at org.hibernate.persister.entity.SingleTableEntityPersister.(SingleTableEntityPersister.java:131)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:267)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at sample.PopulateMessages.main(PopulateMessages.java:13)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107)
... 9 more
Caused by: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:208)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:186)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.(AbstractEntityTuplizer.java:151)
at org.hibernate.tuple.entity.PojoEntityTuplizer.(PojoEntityTuplizer.java:78)
To resolve this, since i am using maven to build, I introduced the dependency on the javassist jar in the pom.xml file.

<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.4.GA</version>
</dependency>

This resolved the issue.


Comments

  1. I'm not using maven but tried adding javaassist.jar but still getting the same problem.Any other suggestion?

    ReplyDelete
  2. Can you provide more details? Let me know if the problem is still not resolved.

    ReplyDelete
  3. I had the same problem and javaassist.jar did not help.

    In my case, this happened when getter and setter spellings are not consistent or when such setter/getter did not exist at all.

    For example:
    If you had a member with the name ABC
    and the getter was getMyABC()

    ReplyDelete
  4. Replies
    1. add the latest version of asm.jar
      Thanx,
      Ashutosh

      Delete
  5. In my case it did help. Although I don't understand this and neither do I get why this is not mentioned in the books you read about Spring/hibernate... Very strange and not at all trustworthy...

    ReplyDelete
  6. add the latest version of asm.jar

    Ashutosh

    ReplyDelete
  7. Hi Mr. Abhi.

    I'm getting error

    org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]


    But here it throws an exception

    org.hibernate.MappingException: component class not found: com.pgapp.comm.InmateId

    Where I changed my class name InmateId as InmateData,

    then why it taking removed class

    Can u pls help me how to resove it..

    This Error caught in Myeclipse



    Thanks


    ReplyDelete
  8. How to get to Mango Resort & Casino at Harrah's Philadelphia by Bus
    Directions to Mango Resort & Casino 남원 출장샵 (Harrah's 사천 출장샵 Philadelphia) with 부산광역 출장안마 public transportation. The following 태백 출장샵 transit lines have routes 영천 출장마사지 that pass near

    ReplyDelete

Post a Comment

Popular posts from this blog

Hibernate: a different object with the same identifier value was already associated with the session

BeanDefinitionStoreException: Failed to parse configuration class: Could not find class [javax.jms.ConnectionFactory]