-->
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.  [ 9 posts ] 
Author Message
 Post subject: HibernateTools: search of .hbm.xml not relative to cfg.xml
PostPosted: Fri Nov 24, 2006 10:48 am 
Newbie

Joined: Thu Nov 16, 2006 1:39 am
Posts: 13
Hi

I have the config below


Code:
top
  |
  |--->src
          |--->hibernate.cfg.xml
          |--->net
                 |--->generated
                         |---> All my .hbm.xml and .java files


top is the root of my Eclipse project

My .hbm.xml are listed in my hibernate.cfg.xml file. Everything works fine :-)

I wish to use Hibernate tools 3.2 beta 8 within Eclipse.

I create a console as in the documentation.

When I try to open it in the Hibernate Configurations view, Eclipse complains it can find net/generated/my.hbm.xml file. A org.hibernate.MappingNotFoundException is thrown.
The search of the .hbm.xml files is not relative to the location of the hibernate.cfg.xml.

Is there something I do wrong ??

Thanks

Jean-Paul


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 24, 2006 12:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the position does not matter if they aren't in the classpath of the console configuration.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 4:39 pm 
Newbie

Joined: Thu Apr 14, 2005 1:23 pm
Posts: 3
Same problem as the OP.

Could you please explain a bit more where/how to set the classpath for the console configuration in the Eclipse tool. Do you mean the classpath for Eclipse itself, a project specific configuration file, ... cannot find any entry for configuration classpath in the Eclipse tool itself.

Or are you referring to the Classpath box at the bottom of the Console config page that seems to say it is "only" for POJO and driver jars?

Thanks ...


Last edited by gbrose on Mon Dec 18, 2006 4:56 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 4:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
its setup in the console configuration together with everything else.

in the upcoming release we will automatically take the eclipse project classpath so will be easier to use.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 2:42 pm 
Newbie

Joined: Mon Sep 18, 2006 6:28 am
Posts: 5
We have our mappings under:

src/main/resources/hibernate/mappings

Hibernate Tools under Eclipse in windows find them!

but under Eclipse in linux it comes with: MappingNotFoundException

So could we define the classpath with "Edit Configuration" then on a .properties file ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 15, 2007 2:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
huh ?

not near enough info to help you.

are you sure it is not a casing issue since linux is case sensitive where as windows is not.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 4:55 am 
Newbie

Joined: Mon Sep 18, 2006 6:28 am
Posts: 5
No its not the case. We call files exactly without any case sensitive's mistake.

On Hibernate Console Configuration,
under Configuration File i call my xml
/APP/src/main/resources/hibernate/config/hibernate.test.cfg.xml

And the mappings in this file are defined as:
<mapping resource="hibernate/mappings/Mytb.hbm.xml" />

But as I stayed above, on windows all is ok but on linux it says:

Lazy tree error
Errror while fetching children
Reason: org.hibernate.MappingNotFoundException resource:
hibernate/mapppings/Mytb.hbm.xml not found

So we can't use HQL Editor, etc on linux :(

So can it ve solved in any way by defining some properties file and load it on the Console Configuration ?

Anyone tested they HIbernate Console Cofiguration on Eclipse Linux ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 5:23 am 
Newbie

Joined: Mon Sep 18, 2006 6:28 am
Posts: 5
Well now with Hibernate Tools 3.2.0 nodeps beta9 Eclipse linux queries HQL fine !


Top
 Profile  
 
 Post subject: Re: HibernateTools: search of .hbm.xml not relative to cfg.xml
PostPosted: Thu Jul 09, 2009 4:46 pm 
Newbie

Joined: Wed May 24, 2006 4:40 pm
Posts: 10
I had a similar problem: Have the hbm.xml file in classpath, but runtime wasn't picking it up.

Just realized that I was using "...mapping file=..." where I should have been using "...mapping resource=..."

It works fine now.

HTH someone else.

_________________
http://www.ajaygautam.com/


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