Hibernate 4.3.11 下问题的解决

  1. 2017.01.09
    问题:hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
    解决:
new  Configuration().configure().buildSessionFactory( new 
    StandardServiceRegistryBuilder().build() );

修改成:

Configuration cfg = new Configuration().configure();  
  
            StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()  
                    .applySettings(cfg.getProperties()).build();  
            cfg.buildSessionFactory(serviceRegistry); 
posted @ 2017-01-09 19:23  ryanleo  阅读(221)  评论(0编辑  收藏  举报