-->
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: Schema text failed:Could not read mapping document from file
PostPosted: Thu Oct 19, 2006 8:34 am 
Newbie

Joined: Thu Oct 19, 2006 8:09 am
Posts: 1
I am a newbie to Hibernate and using one of the tutorials.

My version of Hibernate is 3.1 and I use ant to try to generate the sql from a .hbm file (below).

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

<hibernate-mapping>

<class name="events.Event" table="EVENTS">
<id name="id" column="EVENT_ID">
<generator class="native"/>
</id>
<property name="date" type="timestamp" column="EVENT_DATE"/>
<property name="title"/>
</class>

</hibernate-mapping>

I use Eclipse as my IDE which, when I open this hbm file, loads/caches the dtd and does not show any errors. However when I run the ant schema export task I get the message in the subject title.The ant task is:

<target name="schema-export" description="Generate DDL from .hbm files">
<taskdef name="schema-export" classname="org.hibernate.tool.hbm2ddl.SchemaExportTask" classpathref="libraries" />

<schema-export properties="hibernate.properties" quiet="no" text="no" drop="no" delimiter=";" output="schema-export.sql">
<fileset dir="${sourcedir}">
<include name="**/*.hbm.xml" />
</fileset>
</schema-export>

</target>

with the following output:

Buildfile: C:\Documents and Settings\aschulew\workspace\TestHibernate\src\build.xml
schema-export:
[schema-export] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[schema-export] log4j:WARN Please initialize the log4j system properly.

BUILD FAILED
C:\Documents and Settings\aschulew\workspace\TestHibernate\src\build.xml:58: Schema text failed: Could not read mapping document from file: C:\Documents and Settings\aschulew\workspace\TestHibernate\src\events\Event.hbm.xml

Total time: 5 seconds


Can someone please give me a pointer as to the problem ?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 9:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
run with -verbose and/or put a log4j.xml or log4j.properties somewhere so you can get the true cause.

it is probably not finding the correct classes.

_________________
Max
Don't 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.