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.  [ 2 posts ] 
Author Message
 Post subject: org.hibernate.MappingNotFoundException
PostPosted: Tue Dec 16, 2008 7:04 am 
Newbie

Joined: Mon Dec 15, 2008 3:57 am
Posts: 11
My Project directory structure is
web-inf
classes
hibernate
*.hbm.xml

when i call below method
configuration.addFile("\\hibernate\\SystemMessages.hbm.xml");

i am getting the exception


org.hibernate.MappingNotFoundException: file: .\hibernate\SystemMessages.hbm.xml not found
at org.hibernate.cfg.Configuration.addFile(Configuration.java:301)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:287)
at com.conductor.analytics.uiapi.factory.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:53)
at com.conductor.analytics.uiapi.factory.BaseHibernateDAO.getSession(BaseHibernateDAO.java:35)
at com.conductor.analytics.uiapi.dao.impl.GlobalConfigDAOImpl.findById(GlobalConfigDAOImpl.java:92)
at com.conductor.analytics.uiapi.util.PropertiesResource.getGlobalConfigValueByKey(PropertiesResource.java:51)
at com.conductor.analytics.uiapi.scheduler.QuartzSchedulerServlet.init(QuartzSchedulerServlet.java:42)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 16, 2008 2:35 pm 
Newbie

Joined: Mon Dec 15, 2008 2:28 pm
Posts: 8
In the Java class where you are loading the configuration file, write some Java code to create a new java.io.File object and print out its location.

This'll tell you where your Java class thinks it is...then figure out the relative path from that location to your hibernate configuration file.

It's possible you may have to use a path such as "..\..\hibernate\xyz.hbm.xml"

_________________
Naresh
Please rate replies if they've helped you out.


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

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.