This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes getting Hibernate error: Could not parse configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "getting Hibernate error: Could not parse configuration" Watch "getting Hibernate error: Could not parse configuration" New topic

getting Hibernate error: Could not parse configuration

Sarvesh Pal

Joined: May 30, 2013
Posts: 1
My hibernate.cfg.xml is below and i am getting the errors which is below the cfg.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-configuration SYSTEM "" PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN">
<!-- Database connection settings -->
<property name="connection.driver_class">org.postgresql</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/hibernatedb</property>
<property name="connection.username">postgres</property>
<property name="connection.password">password</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<!-- Drop and re-create the database schema on startup -->
<property name="">create</property>

<!-- Names the annotated entity class -->
<mapping class="com.dto.UserDetails"/>



______________errors Below___________please HElp___________________ Please Help with Errors__________________________________________________________

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(
at org.hibernate.cfg.Configuration.configure(
at org.hibernate.cfg.Configuration.configure(
at com.hibernate.HibernateTest.main(
Caused by: org.dom4j.DocumentException: Error on line 3 of document : The document type declaration for root element type "hibernate-configuration" must end with '>'. Nested exception: The document type declaration for root element type "hibernate-configuration" must end with '>'.
at org.hibernate.cfg.Configuration.doConfigure(
... 3 more

Balaji Vankadaru
Ranch Hand

Joined: May 31, 2013
Posts: 48
Just try to update your sl4j jar. The current version which your have included is not supporting the cause. Just this change would allow your code to run like a champ.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: getting Hibernate error: Could not parse configuration
It's not a secret anymore!