1 Reply Latest reply on Dec 20, 2007 8:01 AM by Pete Muir

    Hibernate MappingException with javassist altered class

    Alan Feng Novice

      I think this one definitely needs some insights from the Seam team.

      I have to use a Hibernate mapping file instead of EJB3 Entity class in order to take advantage of my existing project code.

      When persisting a Seam annotated POJO, which is mapped in the Hibernate mapping file, I receives a MappingException: Unknown entity: com....MyPojoClass_$$_javassist_1

      Trace into the Hibernate code, I found out the following:
      1. The mapping of my class MyPojoClass is loaded properly after examining the Hibernate entityPersisters map.
      2. When retrieving the class name, Hibernate gets a name of MyPojoClass_$$_javassist_1 instead of just MyPojoClass. This cause the Hibernate to throw exception as it can not find this class name in its entityPersisters map.

      Why javassist alters the classname it returns from the object.getClass().getName() call?

      This is a road blocker and I can't not seem to bypass this error. Please help!