Estou quebrando a cabeca.
Ja procurei no forum e nao acho a solucao. Alguem saberia me dizer como arrumar isto?
Eu to assistindo as video aulas do prof. neri e ele conseguiu e eu nao... Estranho....
run:
15 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
47 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
47 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
62 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
125 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: hibernate.cfg.xml
125 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: hibernate.cfg.xml
219 [main] ERROR org.hibernate.util.XMLHelper - Error parsing XML: hibernate.cfg.xml(15) Document root element "hiberate-configuration", must match DOCTYPE root "hibernate-configuration".
234 [main] ERROR org.hibernate.util.XMLHelper - Error parsing XML: hibernate.cfg.xml(15) Element type "hiberate-configuration" must be declared.
CONSTRUÍDO COM SUCESSO (tempo total: 5 segundos)
Configuracao do Hibernate
Mapeamento do aluno"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
org.gjt.mm.mysql.Driver
jdbc:mysql://javahibernate
root
123
org.hibernate.dialect.MySQLDialect
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : hibernate.cfg.xml
Created on : 28 de Setembro de 2010, 21:35
Author : Anderson Luiz
Description:
Purpose of the document follows.
-->
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Aluno" table="alunos">
<id name="alu_codigo" colunm="alu_codigo" type="integer"/>
<property name="alu_nome"/>
<property name="alu_cidade"/>
<property name="alu_fone"/>
<property name="alu_curso"/>
</class>
</hibernate-mapping>
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Anderson Luiz
*/
import javax.swing.JOptionPane;
import org.hibernate.*;
import org.hibernate.cfg.*;
public class GravaAluno {
public static void main(String[] args){
try{
SessionFactory fabrica = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
Session sessao = fabrica.openSession();
Aluno aluno = new Aluno();
aluno.setAlu_codigo(1);
aluno.setAlu_nome("Anderson Luiz");
aluno.setAlu_curso("Sistemas");
aluno.setAlu_fone("4455-2511");
aluno.setAlu_cidade("Santo andre");
Transaction tx_aluno = sessao.beginTransaction();
sessao.save(aluno);
tx_aluno.commit();
sessao.close();
}catch(Exception erro){
JOptionPane.showMessageDialog(null, "Erro na insercao: " + erro);
}
}
}
Estou anexando no post o print screen do erro
