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

后端 未结 6 1052
南旧
南旧 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:27

    Your problem is creation session Factory for your application it happening in HibernateUtilities class , the reason may be due to , you cannot create a sessionfactory by sessionRegistry create it by hibernate Configuration class, because you registered your configuration in hibernate.cfg.xml

    Just Replace the following code in HibernateUtilities class

            `sessionFactory = configuration.buildSessionFactory(serviceRegistry);`
    

    to

            `sessionFactory = configuration.buildSessionFactory();`
    

提交回复
热议问题