org.hibernate.MappingException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • spring + hibernate
    via by manu chaox,
  • Hi, I'm trying Hibernate annotations program along with a business object having 4 attributes. I referred one of the online tutorial and created BO class with annotations, HibernateUtil.java, hibernate.cfg.xml, and .java with main method in it for execution. Everything compiled successfully in eclipse but while executing I got below mentioned exception: Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.flylite.ticketing.model.FlightMaster at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:557) at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1342) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:539) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:527) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:318) at $Proxy9.save(Unknown Source) at com.flylite.ticketing.application.TestFlightManager.main(TestFlightManager.java:23) I followed all the steps as per given in tutorial apart from @Table (name="") as we have to use appliesTo in latest version. I doubt (I may be wrong) on @Table(appliesTo="") tag, as I tried similar program couple of months back with lower version of Hibernate where tag was @Table(name=""), and it ran successfully. Please helpe me in this issue. Let me know in case I need to upload my files. Regards Mandar
    via by Mandar Shukla,
  • Hi, I'm trying Hibernate annotations program along with a business object having 4 attributes. I referred one of the online tutorial and created BO class with annotations, HibernateUtil.java, hibernate.cfg.xml, and .java with main method in it for execution. Everything compiled successfully in eclipse but while executing I got below mentioned exception: Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.flylite.ticketing.model.FlightMaster at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:557) at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1342) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:98) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:539) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:527) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:318) at $Proxy9.save(Unknown Source) at com.flylite.ticketing.application.TestFlightManager.main(TestFlightManager.java:23) I followed all the steps as per given in tutorial apart from @Table (name="") as we have to use appliesTo in latest version. I doubt (I may be wrong) on @Table(appliesTo="") tag, as I tried similar program couple of months back with lower version of Hibernate where tag was @Table(name=""), and it ran successfully. Please helpe me in this issue. Let me know in case I need to upload my files. Regards Mandar
    via by Mandar Shukla,
  • hibernate3.3-spring3 project
    via by pra div,
  • hibernate3 save method exception
    via by pra div,
  • Hibernate mapping exception: unknow entity
    via Stack Overflow by Ali Asad
    ,
    • org.hibernate.MappingException: Unknown entity: sts.business.entities.IndustryBo at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:628) at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1366) at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210) at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195) at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50) at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93) at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:563) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:551) at org.hibernate.impl.SessionImpl.save(SessionImpl.java:547) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) at $Proxy3.save(Unknown Source) at sts.business.dao.impl.IndustryDaoImpl.insertIndustry(IndustryDaoImpl.java:43) at sts.business.entities.TestSpringApp.main(TestSpringApp.java:24)

    Users with the same issue

    Unknown visitor1 times, last one,
    pnaranja
    1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,