I am using Hibernate 2.1.2 with Resin 2.1.6 as my Application Server.
This topic may have been discussed before and I apologize in advance if it has. The issue I have is with the Configuration object being unable to find hibernate.cfg.xml file when I move my code to Linux.
I tried doing both
Code:
sessionFactorySAP = new Configuration().configure().buildSessionFactory();
and
Code:
sessionFactorySAP = new Configuration("/hibernate.cfg.xml").configure().buildSessionFactory();
Both work on the Windows machine. But on my Linux machine I get the following stack trace.
Code:
net.sf.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:917)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:856)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:842)
at com.foo.bar.utilities.HibernateManager.<clinit>(Unknown Source)
at com.foo.bar.dao.user.UserDAO.search(Unknown Source)
at com.foo.bar.control.site.access.LoginAction.update(Unknown Source)
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:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:252)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
at com.caucho.server.http.Invocation.service(Invocation.java:312)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:342)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:272)
at com.caucho.server.TcpConnection.run(TcpConnection.java:137)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.dom4j.DocumentException: Validation not supported for XMLReader: com.caucho.xml.Xml@171120a Nested exception: http://xml.org/sax/features/validation Nested exception: Validation not supported for XMLReader: com.caucho.xml.Xml@171120a Nested exception: http://xml.org/sax/features/validation
at org.dom4j.io.SAXReader.read(SAXReader.java:358)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:912)
... 23 more
I am not discounting the fact that this could also be caused by the following issue:
http://www.hibernate.org/120.html#A11
But I don't understand why everything works fine on my NT box but won't on Linux. I have not changed the Parser settings on my Windows box.
Any suggestions?