-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate works with standalone app but problems with WebApp
PostPosted: Wed Oct 07, 2009 3:14 am 
Newbie

Joined: Wed Oct 07, 2009 2:53 am
Posts: 5
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.