Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/03/2009, 20:47
Avatar de Drknow
Drknow
 
Fecha de Ingreso: febrero-2008
Mensajes: 121
Antigüedad: 16 años, 2 meses
Puntos: 1
De acuerdo Persistencia Hibernate denme una mano

Hola que tal estoy comenzando ha estudiar Hibernate y nuevas maneras de programar estoy haciendo mi primera aplicacion con hibernate en consola con una BD en mysql tengo todo no me sale ningun error de falta de librerias ni nada solo me sale una hibernateException , como pueden ver este ejemplo es para abrir y cerrar nada dificil., pero como pueden ver la aplicacion nunca finaliza por que tiene un exception

esta es mi clase :

Código PHP:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package persistencia;

import org.hibernate.HibernateException;
import org.hibernate.cfg.Configuration;
import org.hibernate.SessionFactory;

/**
 *
 * @author (((Ju@n)))
 */

public class EventManager {


    public static 
void main(String[]args){
        new 
EventManager();
    }

    private 
SessionFactory session;

    public 
EventManager(){
        try{
            
System.out.println("Iniciando Hibernate");
          
            
session = new Configuration().
                    
configure().buildSessionFactory();
            
System.out.println("Finalizando la Iniciacion de Hibernate");

            
System.exit(0);
            
        }catch(
HibernateException ex){
            
System.out.println(ex.getMessage() + ex.getLocalizedMessage() +
                    
ex.getCause());
           
// ex.printStackTrace();
        
}
    }



El run :
Código PHP:
run:
Iniciando Hibernate
06
/03/2009 09:20:55 PM org.hibernate.cfg.Environment <clinit>
INFOHibernate 3.2.5
06
/03/2009 09:20:55 PM org.hibernate.cfg.Environment <clinit>
INFOhibernate.properties not found
06
/03/2009 09:20:55 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO
Bytecode provider name cglib
06
/03/2009 09:20:55 PM org.hibernate.cfg.Environment <clinit>
INFOusing JDK 1.4 java.sql.Timestamp handling
06
/03/2009 09:20:55 PM org.hibernate.cfg.Configuration configure
INFO
configuring from resource: /hibernate.cfg.xml
06
/03/2009 09:20:55 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO
Configuration resource: /hibernate.cfg.xml
06
/03/2009 09:20:55 PM org.hibernate.cfg.Configuration addResource
INFO
Reading mappings from resource Event.hbm.xml
06
/03/2009 09:20:55 PM org.hibernate.util.XMLHelper$ErrorLogger error
GRAVE
Error parsing XMLXML InputStream(8The content of element type "class" is incompleteit must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)".
06/03/2009 09:20:55 PM org.hibernate.util.XMLHelper$ErrorLogger error
GRAVE
Error parsing XMLXML InputStream(16The content of element type "hibernate-mapping" must match "(meta*,typedef*,import*,(class|subclass|joined-subclass|union-subclass)*,resultset*,(query|sql-query)*,filter-def*,database-object*)".
Could not parse mapping document from resource Event.hbm.xmlCould not parse mapping document from resource Event.hbm.xmlorg.hibernate.InvalidMappingExceptionCould not parse mapping document from invalid mapping
GENERACIÓN CORRECTA 
(tiempo total0 segundos
lo que mas me interesa es esta parte
Event.hbm.xmlorg.hibernate.InvalidMappingException : Could not parse mapping document from invalid mapping

que significa ? o que le falta al Event.hbm.xml es donde hago el mapeo con mi clase