-->
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: SchemaExport hibernate.cfg.xml not found bug
PostPosted: Mon Dec 27, 2004 11:48 pm 
Newbie

Joined: Mon Dec 27, 2004 11:37 pm
Posts: 4
Hibernate version: 2.1.6

Full stack trace of any exception that occurs:
2004-12-27 22:36:05,365 INFO [main] (Environment.java:469) - Hibernate 2.1.6
2004-12-27 22:36:05,384 INFO [main] (Environment.java:498) - hibernate.properties not found
2004-12-27 22:36:05,395 INFO [main] (Environment.java:529) - using CGLIB reflection optimizer
2004-12-27 22:36:05,419 INFO [main] (Configuration.java:895) - configuring from resource: hibernate.cfg.xml
2004-12-27 22:36:05,421 INFO [main] (Configuration.java:867) - Configuration resource: hibernate.cfg.xml
2004-12-27 22:36:05,424 WARN [main] (Configuration.java:871) - hibernate.cfg.xml not found
2004-12-27 22:36:05,437 ERROR [main] (SchemaExport.java:310) - Error creating schema
net.sf.hibernate.HibernateException: hibernate.cfg.xml not found
at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:872)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:896)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:275)
net.sf.hibernate.HibernateException: hibernate.cfg.xml not found
at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:872)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:896)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:275)

Name and version of the database you are using: postgresql 7.4

Debug level Hibernate log excerpt: DEBUG

I traced through the source and the reason why hibernate.cfg.xml is not found is because it expects it in net/sf/hibernate/cfg. hibernate.cfg.xml I am running SchemaExport in eclipse and made sure that my hibernate.cfg.xml is in the classpath. Is this a bug or am I doing something wrong?


Top
 Profile  
 
 Post subject: SchemaExport hibernate.cfg.xml not found
PostPosted: Sun Jan 02, 2005 10:38 pm 
Newbie

Joined: Sun Jan 02, 2005 10:17 pm
Posts: 13
I too have this problem when using the SchemaExport tool. I was trying to generate the ddl from the .hbm.xml file using SchemaExport from command line. Here's the command I entered:

java -classpath hibernate2.jar;odmg-3.0.jar;log4j-1.2.8.jar;ehcache-0.9.jar;dom4j-1.4.jar;commons-logging-1.0.4.jar;commons-collections-2.1.1.jar;cglib-full-2.0.2.jar net.sf.hibernate.tool.hbm2ddl.SchemaExport --text --output=catTable.ddl --config=hibernate.cfg.xml --properties=hibernate.properties --format Cat.hbm.xml


I have confirmed and re-confirmed that all the listed JAR files, hibernate.cfg.xml, and Cat.hbm.xml files exists in the expected directory and are spelled correctly. The following is the error received:

net.sf.hibernate.HibernateException: hibernate.cfg.xml not found
at net.sf.hibernate.cfg.Configuration.getConfigurationInputStream(Config
uration.java:872)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:896)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:275
)


I am running on XP using Hibernate 2.1.6. I would appreciate any comments and suggestions. Thanks in advance!


Top
 Profile  
 
 Post subject: work around
PostPosted: Sun Jan 02, 2005 11:50 pm 
Newbie

Joined: Mon Dec 27, 2004 11:37 pm
Posts: 4
the work around I use was to put hibernate.cfg.xml in net/sf/hibernate/cfg

make sure net/sf/hibernate/cfg is in your classpath. this is a hack


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.