-->
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: schemaexport ant hibernate.cfg.xml not found
PostPosted: Wed Sep 08, 2004 7:02 am 
Newbie

Joined: Wed Sep 08, 2004 6:23 am
Posts: 4
Hibernate version: 2.1.6

first a short question and then the explanation.

Is it right that the ant task "schemaexport" looks for his property named config in the directory where ant is called?

Explanation:
when using the schemaexport task in ant there is an error i doen't understand completly.
When i call the target in a build-file, let's say a.xml and i call ant in the root
directory of the project anything works. btw the junit-subdir is directly under the root directory

Code:
   <target name="drop-schema">
      <schemaexport   
         config="junit/hibernate.cfg.xml"
         quiet="yes"
         drop="yes"
      >
      </schemaexport>
   </target>   


when i call the same target from another location or another build-file (b.xml) schemaexport fails with "File Not Found". I played with several Configurations, telling ant where basedir is, telling ant not to inherit ...

The only solution was, to copy junit/hibernat.cfg.xml to that point, where i called ant. Then it worked.

Any suggestions?

Best Regards
Gunnar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 10:36 am 
Newbie

Joined: Wed Sep 08, 2004 6:23 am
Posts: 4
got it!

it's not a problem of the schemaexport task. It's more my problem
using the property task in ant.

Do NOT use value instead use location when you want
to define a directory or file.

for example use:
Code:
<property name="hibernate.cfg.xml.test" location="${junit.dir}/hibernate.cfg.xml" />


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.