Hibernate Exception in thread "main" java.lang.ExceptionInInitializerError
<p>I am brand new to Hibernate so please go easy on me! 
I am just trying to open and close a hibernate session as follows: 
Program.java is as follows: 
    package com.simpleprogrammer;</p>

<pre><code>import org.hibernate.Session;

public class Program {
    public static void main(String[] args) {
        System.out.println("Hello world!");
        Session session = HibernateUtilities.getSessionFactory().openSession();
        session.close();
    }
}
</code></pre>

<p>and my HibernateUtilities.java file is as follows: </p>

<pre><code>package com.simpleprogrammer;

import org.hibernate.HibernateException;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;

public class HibernateUtilities {
    private static SessionFactory sessionFactory;
    private static ServiceRegistry serviceRegistry;

    static {
        try
        {
            Configuration configuration = new Configuration().configure();
            serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
            sessionFactory = configuration.buildSessionFactory(serviceRegistry);
        }
        catch (HibernateException exception)
        {
            System.out.println("Problem creating session factory");
        }
    }
    public static SessionFactory getSessionFactory()
    {
        return sessionFactory;
    }
}
</code></pre>

<p>and finally my hibernate.cfg.xml file is as follows: </p>

<pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
&lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
    &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
    &lt;property name="connection.password"&gt;password&lt;/property&gt;
    &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306&lt;/property&gt;
    &lt;property name="connection.username"&gt;appuser&lt;/property&gt;
    &lt;property name="connection.default_schema"&gt;protien_tracker&lt;/property&gt;
    &lt;property name="connection.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
    &lt;property name="connection.show_sql"&gt;true&lt;/property&gt;

      &lt;!-- &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt; --&gt;
  &lt;/session-factory&gt;
&lt;/hibernate-configuration&gt;
</code></pre>

<p>When I try to run this, I am getting a null pointer exception, stack trace is as follows: </p>

<pre><code>"C:\Program Files\Java\jdk1.8.0_45\bin\java" -Didea.launcher.port=7537 "-Didea.launcher.bin.path=C:\Users\John Stafford\AppData\Roaming\JetBrains\IntelliJ IDEA 15.0.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_45\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_45\jre\lib\rt.jar;C:\Java\intellij\ProtienTracker\out\production\ProtienTracker;C:\Java\intellij\ProtienTracker\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar;C:\Java\intellij\ProtienTracker\lib\antlr-2.7.7.jar;C:\Java\intellij\ProtienTracker\lib\hibernate-commons-annotations-4.0.2.Final.jar;C:\Java\intellij\ProtienTracker\lib\jboss-logging-3.1.0.GA.jar;C:\Java\intellij\ProtienTracker\lib\dom4j-1.6.1.jar;C:\Java\intellij\ProtienTracker\lib\jboss-transaction-api_1.1_spec-1.0.1.Final.jar;C:\Java\intellij\ProtienTracker\lib\javassist-3.15.0-GA.jar;C:\Java\intellij\ProtienTracker\lib\hibernate-core-4.2.2.Final.jar;C:\Java\intellij\ProtienTracker\lib\mysql-connector-java-5.0.4-bin.jar;C:\Users\John Stafford\AppData\Roaming\JetBrains\IntelliJ IDEA 15.0.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.simpleprogrammer.Program
Hello world!
Jan 20, 2016 9:03:37 PM org.hibernate.annotations.common.Version &lt;clinit&gt;
INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
Jan 20, 2016 9:03:37 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.2.Final}
Jan 20, 2016 9:03:37 PM org.hibernate.cfg.Environment &lt;clinit&gt;
INFO: HHH000206: hibernate.properties not found
Jan 20, 2016 9:03:37 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Jan 20, 2016 9:03:37 PM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
Jan 20, 2016 9:03:37 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
Jan 20, 2016 9:03:38 PM org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
Jan 20, 2016 9:03:38 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
Jan 20, 2016 9:03:38 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
Jan 20, 2016 9:03:38 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
Jan 20, 2016 9:03:38 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306]
Jan 20, 2016 9:03:38 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=appuser, password=****, dialect=org.hibernate.dialect.MySQLDialect, show_sql=true, default_schema=protien_tracker}
Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.simpleprogrammer.Program.main(Program.java:11)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.NullPointerException
    at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:214)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcServicesImpl.java:242)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:117)
    at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
    at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1797)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1755)
    at com.simpleprogrammer.HibernateUtilities.&lt;clinit&gt;(HibernateUtilities.java:18)
    ... 6 more

Process finished with exit code 1
</code></pre>

<p>Does anybody know what I have done wrong here? </p>