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.  [ 2 posts ] 
Author Message
 Post subject: Premature end of file for hbm.xml file
PostPosted: Mon May 14, 2007 10:14 am 
Newbie

Joined: Tue Jul 27, 2004 1:33 pm
Posts: 18
Location: South Africa
Hi all,

I have some hbm.xml files that hibernate doesn't seem to like. The files were generated with hibernate synchronizer and as far as I can see there aren't any problems with them.

Here are the error messages I get from tomcat

org.hibernate.HibernateException: Could not parse configuration:
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1376)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
......

at java.lang.Thread.run(Thread.java:595)
Caused by: org.dom4j.DocumentException: Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1366)
... 49 more


Here is the hbm.xml file



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<hibernate-mapping package="za.co.abc.model">
<class
name="Region"
table="region"
>
<meta attribute="sync-DAO">false</meta>
<id
name="Id"
type="java.lang.Long"
column="id"
>
<generator class="native"/>
</id>

<property
name="Description"
column="description"
type="string"
not-null="false"
length="30"
/>
<many-to-one
name="Province"
column="province_id"
class="Province"
not-null="false"
>
</many-to-one>


<set name="Suburbs" inverse="true">
<key column="id"/>
<one-to-many class="Suburb"/>
</set>
</class>
</hibernate-mapping>


Any help or pointers appreciated.

thanks

_________________
http://www.jumpingbean.co.za
http://www.cyberconnect.co.za
http://www.ip-pbx.co.za
http://www.learndrupal.co.za


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 15, 2007 3:03 am 
Beginner
Beginner

Joined: Mon Nov 06, 2006 2:40 am
Posts: 29
Location: New Delhi, India
problem seems to be with DTD file,
put the hibernate-mapping-3.0.dtd in tomcat classpath

or change the dtd path in hbm.xml to somewhere on your local drive

_________________
Hope this helps... :)

Regards,

Rohit

--Don'f forget to rate...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.