I have hibernate working perfectly on my development server, but when I zip up all the files (including tomcat, java, all JSP, class files, and JAR files) and reproduce this tree on another system with the same newly-installed OS (Redhat Enterprise), Hibernate is failing immediately with the following exception:
System Error: org.hibernate.MappingException: Could not read mapping document from file: /enerlook/jakarta-tomcat/webapps/roverlook/WEB-INF/classes/roverlook/Media.hbm.xml at org.hibernate.cfg.Configuration.addFile(Configuration.java:269) at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:582) at roverlook.HibernateSessionFactory.initialization(HibernateSessionFactory.java:89) at roverlook.HibernateSessionFactory.getCurrentSession(HibernateSessionFactory.java:33) at roverlook.VideoSessionManager.(VideoSessionManager.java:28) at roverlook.RoverlookInterface.(RoverlookInterface.java:50) at roverlook.ServiceManager.(ServiceManager.java:53) at roverlook.ControllerData.initializeData(ControllerData.java:41) at roverlook.StaticPageController.processRequest(StaticPageController.java:38) at roverlook.BasicController.doGet(BasicController.java:44) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
The 'Media.hbm.xml' file is there with the same permissions, checksum, and size as the one on the existing server. There must be some difference between the systems causing this, but I can't fathom what it is. Any ideas?
Just an idea, did you verify that it is not a class issue. This is quite common especially with JBoss application server. Which Server, Java, Hibernate Version do you use?
Best Regards Sebastian
Things get always more complicated as expected.<br />Author of eBook Hibernate 3 Developer Guide by example<br />Tutorials about Hibernate, EJB, Struts, JSF <a href="http://www.laliluna.de" target="_blank" rel="nofollow">www.laliluna.de</a>
Joined: Apr 20, 2004
I found my problem, but I haven't solved it completely. The problem was that the DTD in my .hbm.xml file was pointing to an external source, but I didnt have my name server configured. Unfortunately, I would like this server to work without needing external internet access, so I have tried to compy the .dtd file to my local file system in the same directory as my .hbm.xml files and changed the path to "./(filename)", but it still is unable to find the file.
As a follup question, does anyone know where my default directory would be in this case?
Old XML header:
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
New XML header:
<!DOCTYPE hibernate-mapping SYSTEM "./hibernate-mapping-2.0.dtd" >