Erro: Could not parse mapping document from resource aluno/aluno.hbm.xml  XML
Índice dos Fóruns » Persistência: Hibernate, JPA, JDBC e outros
Autor Mensagem
lucasmartins
Thread.start()
[Avatar]

Membro desde: 14/03/2010 21:07:25
Mensagens: 41
Offline

Bom dia. Estou com esse problema no mapeamento do meu banco.
Seguem os códigos

Hibernate.cfg.xml:


aluno.hbm.xml

GravaAluno


Erros:

run:
07/05/2011 11:03:12 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.5
07/05/2011 11:03:12 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
07/05/2011 11:03:12 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
07/05/2011 11:03:12 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
07/05/2011 11:03:12 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
07/05/2011 11:03:12 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
07/05/2011 11:03:12 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : aluno/aluno.hbm.xml
07/05/2011 11:03:12 org.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: XML InputStream(5) The content of element type "class" is incomplete, it 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)*)".
07/05/2011 11:03:12 org.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: XML InputStream(9) The element type "hibernate-mapping" must be terminated by the matching end-tag "</hibernate-mapping>".



E ai pessoal alguma idéia do que seja?

Abraço

[]'s
Lucas Martins.
[Email] [Yahoo!] [MSN]
rafaelbortoletto
JavaBaby
[Avatar]

Membro desde: 26/01/2007 14:27:01
Mensagens: 95
Localização: São Bernardo do Campo - SP
Offline

Pelo que eu pude perceber existe uma barra a mais fechando a primeira tag <class> no seu XML.

Ficaria assim o código

This message was edited 1 time. Last update was at 07/05/2011 13:09:10

lucasmartins
Thread.start()
[Avatar]

Membro desde: 14/03/2010 21:07:25
Mensagens: 41
Offline

corrigi mas o erro agora é:

run:
09/05/2011 11:08:10 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.5
09/05/2011 11:08:10 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
09/05/2011 11:08:10 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
09/05/2011 11:08:10 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
09/05/2011 11:08:10 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
09/05/2011 11:08:10 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
09/05/2011 11:08:10 org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : Aluno/aluno.hbm.xml
09/05/2011 11:08:10 org.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: XML InputStream(4) The content of element type "class" is incomplete, it 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)*)".
09/05/2011 11:08:10 org.hibernate.util.XMLHelper$ErrorLogger error
SEVERE: Error parsing XML: XML InputStream( The 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*)".
CONSTRUÍDO COM SUCESSO (tempo total: 5 segundos)

[]'s
Lucas Martins.
[Email] [Yahoo!] [MSN]
 
Índice dos Fóruns » Persistência: Hibernate, JPA, JDBC e outros
Ir para:   
Powered by JForum 2.1.8 © JForum Team