This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
so i started learning hibernate, and i was writing my first program. I had everything in place, like i added all hibernate libraries, and placed hibernate.cfg.xml in src folder and i created a class "User" which i had to persist.
I had added that class to '<mapping>' tag (with fully qualified domain name).
But when i run the program, it shows up this....
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" org.hibernate.MappingNotFoundException: resource: org.test.www.model.User not found
and by the way, 'Driver' is my implementation class.
my hibernate.cfg.xml file is as below.....
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
please help me out, i really appreciate it.
canyon quest wrote:Exception in thread "main" org.hibernate.MappingNotFoundException: resource: org.test.www.model.User not found.
So presumably "User" corresponds to a User class in your system? Then you need a Hibernate configuration file for that class in your project. In the same folder as your main Hibernate configuration file would be the best choice, I think.
Thanks for the reply paul, but there is tiny problem. I am learning the hibernate through video tutorials, and if you see the following video "http://www.youtube.com/watch?v=3eXjpve0QaI&feature=relmfu", you will notice that there was no configuration of such .hbm resource file anywhere. I did everything that was shown in the video, but yet i get this error. please can you look into that.