I also had this problem and after searching through many pages I finally found the solution in this thread:
http://forum.hibernate.org/viewtopic.php?t=936082
The key is to change
Code:
<mapping resource="com/example/program/MyClass.hbm.xml"/>
to
Code:
<mapping file="config/MyClass.hbm.xml"/>
This way, you can separate your mapping files from your class files.
I use this to be able to clean my project via an ANT target (which deletes the bin folder where the mapping files have been) without the need to remember to generate the mapping files via another ANT target afterwards.
Hope this helps other people to more quickly find a solution. Perhaps, it could be pointed out in the documentation or FAQ? I searched these but didnĀ“t found it.
Lars