These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Could not parse the configuration
PostPosted: Sat Jul 05, 2008 12:57 am 
Newbie

Joined: Sat Jul 05, 2008 12:46 am
Posts: 1
Hi,

I am new to Hibernate. I am getting basic error. I am trying to create hbm2ddl. I got this error.

Plz help me out.

C:\sample\coolstatedb>ant hbm2ddl
Buildfile: build.xml

init:

build:

hbm2ddl:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2ddl (Generates database schema)
[hibernatetool] log4j:WARN No appenders could be found for logger (org.hibernate
.cfg.Environment).
[hibernatetool] log4j:WARN Please initialize the log4j system properly.
[hibernatetool] An exception occurred while running exporter #2:hbm2ddl (Generat
es database schema)
[hibernatetool] To get the full stack trace run ant with -verbose
[hibernatetool] org.hibernate.HibernateException: Could not parse configuration:
C:\sample\coolstatedb\classes\hibernate.cfg.xml
[hibernatetool] org.dom4j.DocumentException: Error on line 29 of document : The
content of elements must consist of well-formed character data or markup. Neste
d exception: The content of elements must consist of well-formed character data
or markup.

BUILD FAILED
C:\sample\coolstatedb\build.xml:70: org.hibernate.HibernateException: Could not
parse configuration: C:\sample\coolstatedb\classes\hibernate.cfg.xml

Total time: 3 seconds


Top
 Profile  
 
 Post subject: Re: Could not parse the configuration
PostPosted: Mon Jul 07, 2008 3:40 am 
Pro
Pro

Joined: Tue Jun 12, 2007 4:13 am
Posts: 209
Location: Berlin, Germany
ish005 wrote:
Hi,


org.hibernate.HibernateException: Could not parse configuration:
C:\sample\coolstatedb\classes\hibernate.cfg.xml
[hibernatetool] org.dom4j.DocumentException: Error on line 29 of document : The
content of elements must consist of well-formed character data or markup. Neste
d exception: The content of elements must consist of well-formed character data
or markup.



Well just check your cfg.xml - there must something the xml parser doesn't like, i.e. diacritical characters inside a comment.

_________________
Carlo
-----------------------------------------------------------
please don't forget to rate if this post helped you


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 07, 2008 9:25 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Check the XML header. Sometimes if that's not valid, the parsing will fail.

Use a sample file from the Hibernate core download to start with, and edit that to your tastes. Sometimes a very small quote that is missing will mess things up.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.