I am completely new in Hibernate and got such an stacktrace:
hql> from TracksEntity
[2014-04-26 21:13:45] org.hibernate.MappingException: Unable to load clas
i recently experienced this. I checked everything and didn't find anything that might have caused it. In desperation, i just moved the "/>" closer in the mapping and saved it. And it worked. Mysterious...
You can do it by two methods, 2nd one definitely works.
<mapping class="com.sample.yourClass" />
Configuration config = new Configuration(); config.addClass(com.sample.yourClass);
Worked for me:
Changing position of mapping tag in hibernate.cfg.xml for class which was not loading previously.
I kept that at top now.
In my case, I have just redeployed project. Then problem solved!