-->
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.  [ 7 posts ] 
Author Message
 Post subject: Resource Not Found
PostPosted: Fri Dec 12, 2003 2:24 am 
Newbie

Joined: Fri Dec 12, 2003 2:12 am
Posts: 16
I'm trying to get my feet wet with Hibernate, but I'm running into problems setting up the Configuration object (specifically, loading my mappings between objects and the database).

My class root is /src (and it's the root of the classpath). I've put the hibernate.cfg.xml and hibernate.properties there.

The directory structure is, stresstest/hibernate. In "hibernate", I have a file called BoatListing.java, and a mapping file called BoatListing.hbm.xml.

I've tried,

Configuration m_oConfiguration = new Configuration().addClass(BoatListing.class);

"INFO: Mapping resource: stresstest/hibernate/BoatListing.hbm.xml
net.sf.hibernate.MappingException: Resource: stresstest/hibernate/BoatListing.hbm.xml not found"

There is definately a file in stresstest/hibernate called BoatListing.hbm.xml.


Configuration m_oConfiguration = new Configuration().addClass(stresstest.hibernate.BoatListing.class);

"INFO: Mapping resource: stresstest/hibernate/BoatListing.hbm.xml
net.sf.hibernate.MappingException: Resource: stresstest/hibernate/BoatListing.hbm.xml not found"

There is definately a file in stresstest/hibernate called BoatListing.hbm.xml.


Configuration m_oConfiguration = new Configuration().addFile("BoatListing.hbm.xml");

"SEVERE: Could not configure datastore from file: BoatListing.hbm.xml"

I thought the datastore got configured in hibernate.properties. This error doesn't make much sense.


I've tried moving the BoatListing.hbm.xml file up to /src, and moving the hibernate.properties and hibernate.cfg.xml down to /src/stresstest/hibernate, with no luck.

The doc doesn't seem to mention these issues (a trouble-shooting section with common issues would be nice). I am using the latest Hibernate 2.1 with JDK 1.4.2 under Eclipse 2.1.

I hope I'm not doing anything really stupid, but the after reading and re-reading the docs, it looks like it should be straight forward.

Thanks in advance for any help.
David.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 12, 2003 4:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Try adding a leading /. That sometimes helps.


Top
 Profile  
 
 Post subject: Thx for the reply...
PostPosted: Fri Dec 12, 2003 6:58 pm 
Newbie

Joined: Fri Dec 12, 2003 2:12 am
Posts: 16
Was a .jar problem - two versions of Hibernate (1.2 and 2.1) on my computer.


Top
 Profile  
 
 Post subject: hibernate.cfg.xml and hibernate.properteis
PostPosted: Fri Dec 26, 2003 3:25 pm 
Beginner
Beginner

Joined: Fri Dec 26, 2003 3:21 pm
Posts: 23
Location: Jakarta
I read this thread

http://forum.hibernate.org/viewtopic.ph ... te+cfg+xml

and see there is 2 properteis in hibernate that we can use hibernate.properties and hibernate.cfg.xml

I see that Galvin's Workshop use hibernate.cfg.xml.

I try the code to read the User, Item in that workshop using my own code, if I use hibernate.cfg.xml, it is not working, but if i use hiberante.properties.

Anyone can help me how to use that cfg.xml in my code

Thanks

Frans


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2003 6:37 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
"not working" is a too vague description for us to help

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Argh. hibernate.cfg.xml
PostPosted: Wed Dec 31, 2003 1:45 am 
Beginner
Beginner

Joined: Fri Dec 26, 2003 3:21 pm
Posts: 23
Location: Jakarta
This mean I cannot make the hibernate.cfg.xml work, but using hibernate.properties. I put it in the class path. But The Workshop work well. I still cannot understand how it work?

So, if you willing to help me, that is my wish?
:)

Frans


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 31, 2003 4:25 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Search the old posts on this forum, it is very dependent of your env and hard to guess .
Last one on this subject http://forum.hibernate.org/viewtopic.php?t=926724

_________________
Emmanuel


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