I created a small project in my company today. In Hibernate Perspective I try to add new configuration so that I can create entities easily from db tables which have several columns. But when I select my project, it gives me org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
Complete Stack Trace -
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2246)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
at org.hibernate.cfg.Configuration.configure(Configuration.java:2137)
at org.jboss.tools.hibernate.proxy.ConfigurationProxy.configure(ConfigurationProxy.java:100)
at org.hibernate.console.ConfigurationFactory.loadConfigurationXML(ConfigurationFactory.java:355)
at org.hibernate.console.ConfigurationFactory.configureStandardConfiguration(ConfigurationFactory.java:279)
at org.hibernate.console.ConfigurationFactory.buildConfiguration(ConfigurationFactory.java:174)
at org.hibernate.console.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:96)
at org.hibernate.eclipse.console.common.HibernateExtension$5.execute(HibernateExtension.java:166)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at org.hibernate.eclipse.console.common.HibernateExtension.execute(HibernateExtension.java:189)
at org.hibernate.eclipse.console.common.HibernateExtension.buildWith(HibernateExtension.java:163)
at org.hibernate.eclipse.console.common.HibernateExtension.build(HibernateExtension.java:134)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:189)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:43)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:98)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:104)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
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:2238)
... 18 more
Even after using many hibernate versions and changing DTD many times I am not able to figure out the issue. Can someone please help me on this. It is a simple maven project and .cfg.xml file is placed into src/main/java
I even downloaded a simple project from this url http://www.mkyong.com/hibernate/maven-3-hibernate-3-6-oracle-11g-example-xml-mapping/ and then tried to add new configuration but again got the same problem. I just changed the respective DB credentials I had. They are correct since using the same jdbc url I have created a new DB connection in Data Source Explorer successfully. Kindly help.
Internet is working fine in my company.
Try changing the DTD definition in the
hibernate.cfg.xml
from:to:
This way the XML parser will not attempt to load the DTD file from the Internet, but it will try to load it from the Hibernate jars.