I´m trying to create a MySQL database table by using hibernate but I get this error message:
Exception in thread \"main\" org.hibernate.HibernateException: E
You need to close the tag <hibernate-configuration
.
<hibernate-configuration>
There is not the !
character in the DOCTYPE
:
<DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
Should be
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
I faced the same issue. It turns out that system is not able to access the hibernate-configuration-3.0.dtd from the url provided.
<DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
So, I referenced it from the local system.
<!DOCTYPE hibernate-configuration SYSTEM
"classpath://org/hibernate/hibernate-configuration-3.0.dtd">
Worked well for me. Hope it helps!
cleared the space at the begining of hibernate.cfg.xml file. lt worked
<?xml version="1.0" encoding="UTF-8"?>