-->
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.  [ 4 posts ] 
Author Message
 Post subject: schemaexport ant task error
PostPosted: Fri Nov 04, 2005 7:10 pm 
Newbie

Joined: Fri Apr 08, 2005 11:16 am
Posts: 10
Hibernate version:
3.1 rc2 and 3.0.5

I'm using the schemaexport ant task to build database ddl from my *.hbm.xml files. When I run my ant build I get the following error from the schemaexport task

Schema text failed: component class not found: com.mycomp.domain.ItemPK

my schemaexport target in my build file looks like

<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath refid="project.classpath" />
</taskdef>

<target name="generate.ddl" depends="generate.hibernate.hbm">
<schemaexport quiet="no" text="yes" drop="no" delimiter=";"
output="${distribute_dir}/ai.ddl">
<fileset dir="build">
<include name="**//domain/*.hbm.xml" />
</fileset>
</schemaexport>
</target>


the output when running the target looks like this

generate.ddl:
[schemaexport] (cfg.Environment 474 ) Hibernate 3.1 rc2
[schemaexport] (cfg.Environment 504 ) hibernate.properties not found
[schemaexport] (cfg.Environment 520 ) using CGLIB reflection optimizer
[schemaexport] (cfg.Environment 550 ) using JDK 1.4 java.sql.Timestamp handling
[schemaexport] (cfg.Configuration 233 ) Reading mappings from file: /myfiles/com/mycomp/domain/ItemTag.hbm.xml
[schemaexport] (cfg.HbmBinder 266 ) Mapping class: com.mycomp.domain.ItemTag -> ITEMMGR.ITEM_TAG
[schemaexport] (cfg.Configuration 1027) processing association property references
[schemaexport] (cfg.Configuration 1049) processing foreign key constraints

BUILD FAILED
/build.xml:58: Schema text failed: component class not found: com.mycomp.domain.ItemTagPK


There are more tables but I removed them to simplify the output. The funny thing is if I run the target again without rebuilding my java objects(ItemTag and ItemTagPK) everything works fine and the ddl is produced. The error only happens when schemaexport is run on the same pass as my java code was compiled.

I get the same "two pass" behavior when I use hibernate 3.0.5 but I get this additional error message from the schemaexport task

[schemaexport] (cfg.HbmBinder 422 ) Could not perform validation checks for component as the class com.mycomp.domain.ItemTagPK was not found

Has anyone seen this? Anyone have advice?

Thanks in Advance

Dave


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 05, 2005 5:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
possibly because the classpath used by schemaexport does not contain the class yet

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 5:33 pm 
Newbie

Joined: Fri Apr 08, 2005 11:16 am
Posts: 10
I tried several things to get the compiled classes onto the classpath but I had little luck. I ended up downloading the hibernate-tools jar and switched to the hibernatetool/hbm2ddl task. This worked so I decided to use it instead of schemaexport.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 5:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes - the hibernate tools hbm2ddl task has better classloading.

uses the same schemaexport though, so no loss ;)

_________________
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.  [ 4 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.