These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]

Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Could not parse configuration: /hibernate.cfg.xml
PostPosted: Thu Oct 13, 2011 2:34 pm 

Joined: Thu Oct 13, 2011 2:01 pm
Posts: 2
Hi all,
I know little about hibernate, and then decided to explore this framework and came across an error!

Could anyone help me?

My application is returning me the following error:
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 

Here is my hibernate.cfg.xml:
<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE hibernate-configuration PUBLIC   
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"   
      <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"/> 

and Mapping (Cadastro.hbm.xml):
<?xml version="1.0"?> 
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    <class name="br.virtual.leo.cadastro.Cadastro" table="CADASTRO"> 
        <id name="id" column="CASDASTRO_ID"> 
            <generator class="native"/> 
        <property name="nome"/> 
        <property name="email"/> 
        <property name="idade"/> 

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.