
Hi! Thank you. That error has gone and i have worked out an example, but its giving a null pointer exception as
org.hibernate.MappingException: Error reading resource: contact.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:447) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1381) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1353) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1335) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1302) at org.hibernate.cfg.Configuration.configure(Configuration.java:1230) at org.hibernate.cfg.Configuration.configure(Configuration.java:1216) at roseindia.tutorial.hibernate.Wtc.main(Wtc.java:14) Caused by: org.hibernate.MappingException: duplicate import: roseindia.tutorial.hibernate.Contact at org.hibernate.cfg.Mappings.addImport(Mappings.java:100) at org.hibernate.cfg.HbmBinder.bindPersistentClassCommonValues(HbmBinder.java:538) at org.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:485) at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:231) at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:149) at org.hibernate.cfg.Configuration.add(Configuration.java:358) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395) at org.hibernate.cfg.Configuration.addResource(Configuration.java:444) ... 7 more Exception in thread "main" java.lang.NullPointerException at roseindia.tutorial.hibernate.Wtc.main(Wtc.java:21)

Hi,
In the Hibernate application is it necessary to place the contact.hbm.xml file in class path.
So, you can put the contact.hbm.xml in src directory or in bin directory of your eclipse project.
So, just try out both and try to fix the error.
Remember in mind that contact.hbm.xml must be present the classpath.
Thanks

Hello,
Please see this thread:
http://www.roseindia.net/answers/viewqa/Hibernate/11916-Reply-to-the-mail(import-files-error).html
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.