Forums Register Login

Could not parse configuration: /hibernate.cfg.xml error

+Pie Number of slices to send: Send
Hello.
I am new to Java web application and hibernate and I am trying this tutorial: http://www.javawebtutor.com/articles/hibernate/hibernate_web_example.html

I am using Eclipse luna 4.4 and install the hibernate tools plugin by "Eclipse Marketplace", and the version is 3.8.0.beta3. Database mysql server 5.6

I did all the things including the codes and libraries exactly the same except some connection parameters, I can run the application and it shows "Details Added Successfully", but finally there is no record added in the Database, and there is such error in the console:
I tried web module 3.1 and tomcat 8 at first, then i changed it to web module 2.5 and tomcat 6, but i also get the same error. As I have googled a lot, I tried many different ways people suggested, but I still cannot get it worked.

"
Could not parse configuration: /hibernate.cfg.xml
GET CAUSE: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
GET TRACE: [Ljava.lang.StackTraceElement;@688430c5
PRINT STACK TRACE:
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1491)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1425)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1411)
at com.jwt.hibernate.dao.UserDAO.addUserDetails(UserDAO.java:17)
at com.jwt.hibernate.controller.UserControllerServlet.doPost(UserControllerServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:526)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:655)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481)
... 28 more
"
my hibernate.cfg.xml:



user.hbm.xml:


thank you very much for your help.
+Pie Number of slices to send: Send
Are you sure that your Database credentials are correct?
+Pie Number of slices to send: Send
Yes, I think so.
thank you.
I will suppress my every urge. But not this shameless plug:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6776 times.
Similar Threads
Attribute "value" must be declared for element type "property"???
Invalid mapping exception in Hibernate
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
Could not parse configuration: /hibernate.cfg.xml
Problem in hibernate programme
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:55:28.