I place a Debug pointer at this line
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
and then press F6.
this is i got.
I can't understand what happen?
i think that it might not finding the hibernate.cfg the you have it on your root source package??... can you handle over a eclipse proyect so i can see if i get the same error??
It's useless to get a File-Object if you don't use ist... Take a look into the Hibernate api-doc, where to put the path to the config-file. And again: just put it into the src-Folder and it works. Hibernate looks for a file named hibernate.cfg.xml there. You only have to configure the path if you don't put into the "root"-folder.
If you put hibernate.cfg.xml into the src-folder and not into any package, Hibernate will find it. If you want to put into a special package take a look into the API and find out that that you have to use new Configuration().configure(SET THE RIGHT FILE *HERE*)....