I tried to test whether the hibernate configuration is working properly. I tried but I got an error:
INFO: HHH000206: hibernate.properties not found
<
The configuration files must be placed in the classpath. Make Sure that the hibernate.cfg.xml is in class-path. As your program is console program, u need to place that hibernate.cfg.xml in src folder. If u have placed it in other folder than specify it in Confingure.configure(fileName);
And as answered By Mr.Kark u have to delete following lines
serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();