Google Search

Friday, June 26, 2009

Hibernate issue


30592 [main] ERROR org.hibernate.LazyInitializationException - could not initialize proxy - no Session
ERROR org.hibernate.util.XMLHelper - Error parsing XML: XML InputStream(8) Element type "class" must be followed by either attribute specifications, ">" or "/>".
Initial SessionFactory creation Could not parse mapping document from resource Person.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.hibernate.tutorial.domain.HibernateUtil.(
at org.hibernate.tutorial.domain.EventManager.createAndStoreEvent(
at org.hibernate.tutorial.domain.EventManager.main(
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource Person.hbm.xml


You need to set lazy="false"

< name="events.Person" table="PERSON" lazy="false">

For good tutorials interview question and forum check here


  1. Thanks man! Your post helped me to get rid of this error :-)

    Greetings from Poland :-)
    Hava a good day.

  2. Wow! this helped me to fix the error too. Thanks a lot and keep up.


please put your Query and comment here.