org.hibernate.HibernateException: /hibernate.cfg.xml not found




Asked on May 11, 2013
Hi All,
 I am new to hibernate and stuck with error, Please help me.

Caused by: 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:1497)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1519)
    at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1194)
    at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:107)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1506)
    at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1188)





Replied on May 11, 2013
Ria, you need to put hibernate.cfg.xml file into the classpath. hibernate.cfg.xml is the file which contains database configuration and mapping of all pojo.


Replied on May 11, 2013
Thanks  Bob,

It works


Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us