Erro persistência

0 respostas
W

Saudações,

estou com um problema ao tentar persistir uma classe, faz um pouco de tempo que não trabalho com Hibernate, estou voltando a estudar o framework, e estou fora de forma. Estou tentando persistir uma classe de exemplo, e aparece o seguinte erro no stacktrace:

log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).

log4j:WARN Please initialize the log4j system properly.

log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a> for more info.

Exception in thread “main” org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1586)

at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:1212)

at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:107)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1520)

at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:1194)

at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:107)

at ExemploPersistencia.main(ExemploPersistencia.java:18)

Caused by: org.dom4j.DocumentException: Error on line 19 of document  : A marcação no documento após o elemento-raiz deve estar correta. Nested exception: A marcação no documento após o elemento-raiz deve estar correta.

at org.dom4j.io.SAXReader.read(SAXReader.java:482)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1576)

Os .jars foram adicionados ao projeto:
logj4-1.2-17.jar
slf4j-api-1.6.jar
slf4j-log4j12-1.7.5.jar
e outros

Se necessário depois coloco as classes,

Criado 11 de dezembro de 2013
Respostas 0
Participantes 1