org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2246) at org.hibernate.cfg.Configuration.configure(Configuration.java:2158) at com.demo.getSessionFactory(HibernateUtil.java:27) at com.demo.openSession(HibernateUtil.java:36)-------------Caused by: org.dom4j.DocumentException: null Nested exception: null at org.dom4j.io.SAXReader.read(SAXReader.java:484) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2238) ... 179 more

If i move the file to some other folder i get :

Code:

org.hibernate.HibernateException: hibernate.cfg.xml not found at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170) at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:2176) at org.hibernate.cfg.Configuration.configure(Configuration.java:2157) at com.demo.getSessionFactory(HibernateUtil.java:27) at com.demo.openSession(HibernateUtil.java:36)

which means it is in right folder for use.

What am i doing wrong, Is there some jar missing?. I am using dependency