Google Search

Friday, June 26, 2009

Hibernate issue

problem



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 failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource Person.hbm.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.hibernate.tutorial.domain.HibernateUtil.(HibernateUtil.java:15)
at org.hibernate.tutorial.domain.EventManager.createAndStoreEvent(EventManager.java:44)
at org.hibernate.tutorial.domain.EventManager.main(EventManager.java:26)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource Person.hbm.xml


Solution

You need to set lazy="false"



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

For good tutorials interview question and forum check here www.classiccoder.com