title: Create Hibernate SessionFactory
body: <p>I get an error: <code>ServiceRegistryBuilder</code> can not be resolved to a type.Please help me to fix an issue:</p>
  
  <pre><code> import javax.imageio.spi.ServiceRegistry;
  
  import org.hibernate.SessionFactory;
  import org.hibernate.cfg.Configuration;
  
  public class HibernateConnectionUtil {
  
      private static HibernateConnectionUtil instance = null;
  
         private static SessionFactory sessionFactory;
         private static ServiceRegistry serviceRegistry;
  
         private HibernateConnectionUtil(){
              Configuration configuration = new Configuration();
              configuration.configure();
              serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
              sessionFactory = configuration.buildSessionFactory(serviceRegistry);
         }
  
         public static HibernateConnectionUtil getInstance(){
              if(instance == null){
                  instance  = new HibernateConnectionUtil();
              }
              return instance;
         }
  
         public static SessionFactory getSessionFactory() {
              return sessionFactory;
         }}
  </code></pre>