• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

hibernate xml not found (jboss plug in)

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys :

Well I finally (by a stroke of luck) got hibernate to generate the
mapping files - but now when I try to refresh them (Im using the jboss eclipse hibernate plug in) it sais "file not foudn dao/Actor.hbm.xml".

I have checked and that xml file is in fact at that location.

Any ideas as to why hibernate cant find files that are in its same directory in eclipse ? Ive even tried moving the xml file to the root directory and it still couldnt be found !

Thanks

-J
 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I found a hack workaround : If you look in the hibernate.cfg.xml file, you will find that all the objects are the xml files have their folder paths on them i.e. an xml map for Object A in directory d is shown as

<mapping resource="d/A.hbm.xml" />

Now, if you remove the d :

<mapping resource="A.hbm.xml" />

And simultaneously make sure that the directory is still a member in the console configuration's classpath, then hibernate will find the hbm.xml file automatically.

I would note that this should be changed... The resource name is defined in 2 places (its path is in class path , its name in the cfg.xml file). It seems like in an effort to decouple data access code from database implementation the folks at hibernate has created plugins that reduce architectural coupling, but in and of themselves, are in fact highly coupled, at times in a very counterintuitive way !

Nevertheless, once I got the maps to generate - it was very cool to see all the working available dao code !

j
 
Ranch Hand
Posts: 47
Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And mine case is reversed.
I was getting same problem . Person.hbm.xml not found.
in hibernate.cfg.xml i had: <mapping resource="org.app.dal.domainobject.mapping.Person.hbm.xml"/>
when i changed this with <mapping resource="org/app/dal/domainobject/mapping/Person.hbm.xml" /> itworkd.
i spent 1-2 hour as i get frustrated why app is not finding hbm file.
Thanks for "hack workaround". i just reversed it.
 
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic