Monday, April 2, 2012

org.hibernate.MappingNotFoundException: resource: mapping/Address.hbm.xml not found


Caused by: org.hibernate.MappingNotFoundException: resource: mapping/Address.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:799)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2344)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2310)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2290)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2243)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
at util.SessionUtil.<clinit>(SessionUtil.java:10)
... 1 more


Reason: hibernate.cfg.xml specifies mapping xml. The Address.hbm.xml mapping file is not exist in the path specified.

Solution: Place the Address.hbm.xml mapping file in the path specified or speciy the path of Address.hbm.xml mapping file or remove the <mapping> resource element in the hibernate.cfg.xml


No comments:

Post a Comment