Could not parse configuration: /hibernate.cfg.xml

Oi pessoal
Eu tenho pouco conhecimento com hibernate e então resolvi explorar mais esta ferramenta mas estou parado com um erro que não consegui resolver!

Se alguém poder me ajudar, Muito obrigado!

A aplicação está retornando o seguinte erro:

16 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
16 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
32 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
32 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
63 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
63 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
Session startup failed org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
	at br.virtual.leo.util.HibernateUtil.<clinit>(HibernateUtil.java:15)
	at br.virtual.leo.cadastro.CadastroManager.main(CadastroManager.java:11)
Caused by: org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1528)
	at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
	at org.hibernate.cfg.Configuration.configure(Configuration.java:1448)
	at br.virtual.leo.util.HibernateUtil.<clinit>(HibernateUtil.java:12)
	... 1 more
Caused by: org.dom4j.DocumentException: Connection reset Nested exception: Connection reset
	at org.dom4j.io.SAXReader.read(SAXReader.java:484)
	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1518)
	... 4 more

Meu arquivo de configuração hibernate.cfg.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC 
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> 

<hibernate-configuration>

    <session-factory>
      <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property>
      <property name="hibernate.connection.username">root</property>
      <property name="hibernate.connection.password">root</property>
      <property name="hibernate.connection.pool_size">10</property>
      <property name="show_sql">true</property>
      <property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
      <property name="hibernate.hbm2ddl.auto">create</property>

	  <mapping resource="br/virtual/leo/cadastro/Cadastro.hbm.xml"/>

    </session-factory>

</hibernate-configuration>

Mapeamento (Cadastro.hbm.xml):

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
	"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

	<class name="br.virtual.leo.cadastro.Cadastro" table="CADASTRO">
	
		<id name="id" column="CASDASTRO_ID">
			<generator class="native"/>
		</id>
		
		<property name="nome"/>
		<property name="email"/>
		<property name="idade"/>
	
	</class>

</hibernate-mapping>	

Muito Obrigado pessoal!

Olá leonardoterrao. No seu arquivo hibernate.cfg.xml, tente alterar a linha 4 de “http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd” para “http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd”.

Eu estava com o mesmo problema e depois que fiz essa alteração funcionou - espero que funcione pra vc tb :slight_smile:

Abraço.

jonasservo realmente era isso!

Muito Obrigado!
Leonardo Terrão