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.
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
Thanks man! Your post helped me to get rid of this error :-)
ReplyDeleteGreetings from Poland :-)
Hava a good day.
Wow! this helped me to fix the error too. Thanks a lot and keep up.
ReplyDelete