- This topic has 4 replies, 4 voices, and was last updated 17 years, 8 months ago by vgbpowertech.
-
AuthorPosts
-
nvmuraliMemberI’m using SPRING + Hibernate.
I take it MyEclipse cannot read an application-data.xml file and pick up where the hibernate mapping files are.
So, I used MyEclipse Hibernate Configuration File Wizard to create a hibernate.cfg.xml file adding in all the hbm files I have.
When I try to get to the HQL Editor view, MyEclipse complains that it cannot read the mapping file. The mapping file is present and there are no errors.
Please help!
nvmuraliMemberThe exact message is “Could not read mappings from resource <filename>”. I tried removing the offending file, and it just moved on to the next one. So any help in this regard would be very much appreciated.
Haris PecoMembernvmurali,
Could you send your hibernate.cfg.xml and one hbm.xml.
It is possible that you have wrong mapping in cfg.xml, for example if you have :
…
<mapping resource=”com/genuitec/test/A.hbm.xml” />
…A.hbm.xml have to be in package com.genuitec.test in your source folder.
It is possible that your hbm.xml is invalid as well.
Regards
Brian FernandesModeratorPlease also note that MyEclipse can read HibernateSessionFactory beans in most Spring configuration files, so creating a separate hibernate.cfg.xml file for your project was not really required.
Whatever configuration file you choose, Spring or Hibernate, please ensure that Project > Properties > MyEclipse-Hibernate > Active Configuration File points to it.
As Peco suggested above, you probably have incorrect paths specified in your configuration file.
vgbpowertechMemberHad the same problem after I moved from MyEclipse 5.1 to 5.5 M1.
The HQL-Editor from 5.1 worked fine. After the update, I got the same error as mentioned above.
The setting of the hibernate.cfg was correct – the path of the mappings too. It´s an system already in productive use. After I changed it to another file and reselected the original one it worked as before. Because in effect I didn´t really change any setting I assume a little bug here…Then another problem appeared: he didn´t find the Oracle-driver. The contents of the user-library was lost. Reconfigured the user-library and now it works as it should…
-
AuthorPosts