Dear All,
Sorry I am new to Hibernate . I have just finished my practice using a Standalone App.When I started with Web-Application with the same environment (Hibernate.cfg.xml and Object.hbm.xml), I am getting the following exception while starting a new Session:-
Code:
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource uk/co/planetbeyond/Object.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:616)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1635)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at uk.co.planetbeyond.HibernateUtil.buildSessionFactory(HibernateUtil.java:13)
... 34 more
Caused by: org.hibernate.MappingException: class uk.co.planetbeyond.Beans.Language not found while looking for property: id
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:232)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:302)
at org.hibernate.cfg.HbmBinder.bindSimpleId(HbmBinder.java:423)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:356)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:295)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:166)
at org.hibernate.cfg.Configuration.add(Configuration.java:716)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:551)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:613)
... 41 more
Caused by: java.lang.ClassNotFoundException: uk.co.planetbeyond.Beans.Language
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:228)
... 49 more
However there occurs no problem while using the same Object.hbm.xml with standalone app.
I am unable to figure this out....
Can anybody help me
Thnaks in advance