Use the following code on the hibernate official documentation to test the times out this exception.
Org.hibernate.HibernateException:Access to Dialectresolutioninfo cannot is null when ' Hibernate.dialect ' not set
Package Org.hibernate.tutorial.util;import Org.hibernate.sessionfactory;import Org.hibernate.boot.registry.standardserviceregistrybuilder;import Org.hibernate.cfg.configuration;public Class Hibernateutil { private static final Sessionfactory sessionfactory = Buildsessionfactory (); private static Sessionfactory Buildsessionfactory () { try { //Create the sessionfactory from hibernate.cfg.xml< C4/>new Configuration (). Configure (). Buildsessionfactory ( new Standardserviceregistrybuilder (). build ()); } catch (Throwable ex) { //Make sure your log the exception, as it might be swallowed System.err.println ("Initial Se Ssionfactory creation failed. "+ ex); throw new Exceptionininitializererror (ex); } } public static Sessionfactory Getsessionfactory () { return sessionfactory; }}
Later changes to the old version of the following code exception disappears:
Configuration cfg = new configuration (); Sessionfactory SF = Cfg.configure (). Buildsessionfactory (); Session session = Sf.opensession ();
However, the Buildsessionfactory method is deprecated in the new version, and the solution is finally found:
Configuration cfg = new configuration (). Configure (); sessionfactory = Cfg.buildsessionfactory (new Standardserviceregistrybuilder (). Applysettings (Cfg.getproperties ()). build ());
It's not going to happen again with the pro test.
[Hibernate] Access to Dialectresolutioninfo cannot is null when ' Hibernate.dialect ' not set