how to fix the error: “INFO: HHH000206: hibernate.properties not found”?

后端 未结 6 1092
南旧
南旧 2020-12-09 10:56

I tried to test whether the hibernate configuration is working properly. I tried but I got an error:

INFO: HHH000206: hibernate.properties not found
<         


        
6条回答
  •  渐次进展
    2020-12-09 11:47

    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();

提交回复
热议问题