-->
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.  [ 8 posts ] 
Author Message
 Post subject: hibernate config file name problem
PostPosted: Fri Dec 26, 2008 2:48 pm 
Newbie

Joined: Fri Dec 26, 2008 2:39 pm
Posts: 2
Hi

I am having a strange problem.

If i name my conf file as hibernate.properties and mapping file as map_table.properties.
This works perfectly well.

But if i name my files as

hibernate.cfg.xml and map_table.xml
my Configuration fails to recognize files it throws a file not found error.

This has nothing to do with file path or location even if i move file location and give the correct path com/db/beans it picks up the file only when i use .properties extension and not .xml or .con.xml extension.


Can't figure out why it's not working, because this is the standard name given in almost all tutorials.

Rama


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 26, 2008 4:41 pm 
Beginner
Beginner

Joined: Mon Sep 01, 2008 9:35 am
Posts: 24
What is your development environment??

I've seen that some eclipse plugins may change the list of filtered resources by adding *.xml and *.html to it. Maybe that is your problem if you are using eclipse.

To check if that is the problem, go to Window->Preferences, than on the menu tree go to Java->Compiler->Building. In that page, there is a list of filtered resources.

Regards,
Vitor.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 27, 2008 4:26 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
i think u must use .hbm extension for ur mapping file.
for eg., Users.hbm.xml

_________________
If u feel it will help you, don't forget to rate me....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 27, 2008 9:50 am 
Newbie

Joined: Sat Dec 27, 2008 9:47 am
Posts: 1
Location: www.tresese.es
The .hbm extension is only a convention so it's optional.

Be sure to include your XML mapping files in the Hibernate config file. Check caps and paths.

_________________
3S - Smart Soft Solutions
info@tresese.es
www.tresese.es


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2008 10:18 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
u may be include DTD file for ur mapping file....

check out ur DTD setting in ur mapping file...

_________________
If u feel it will help you, don't forget to rate me....


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2008 10:55 am 
Newbie

Joined: Fri Dec 26, 2008 2:39 pm
Posts: 2
Thank you all for replies.

Development environment is Eclipse.

DTD tag is this

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


Do you think it could be because i am using an online ref to dtd file.
How can i put it locally.

Rama


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 29, 2008 11:30 am 
Newbie

Joined: Mon Dec 29, 2008 9:26 am
Posts: 2
What does your SessionFactory code look like?
Did you use a generator to product the code or write it?
Finally, what does your config file look like?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 30, 2008 9:09 am 
Regular
Regular

Joined: Wed Oct 15, 2008 6:59 am
Posts: 103
Location: Chennai
use like this

<!DOCTYPE hibernate-mapping SYSTEM "E:\hibernate-mapping-3.0.dtd">

where "E:\hibernate-mapping-3.0.dtd" place for ur dtd file.

download dtd file in ur system.

_________________
If u feel it will help you, don't forget to rate me....


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