title: Hibernate + HikariCP + EHCache session creation fails
body: <p>Previously, I configured well Hibernate + c3p0 + ehcache as show <a href="https://stackoverflow.com/questions/26263861/hibernate-c3p0-pool-ehcache-fail-start">here</a> Now, I try to use a more powerful pool like HikariCP. First, I try to configure Hibernate + HikariCP as show <a href="https://stackoverflow.com/questions/26789871/hibernate-fails-create-sessionfactory-using-hikaricp-pool">in this other post</a>.</p>
  
  <p>Until now, I can use well Hibernate with HikariCP but, when I add EHCache (as show in first link) app fails start. I don't get an error, only app stops try create sessionfactory.</p>
  
  <p><strong>LOG</strong> (I remove some similar lines because stackoverflow don't let me put full log because is very long).</p>
  
  <pre><code>    NetBeans: JPDA Listening Start...
      JPDA Address: ******:50991
      Port:50991
      cd D:\****\Código; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_40" cmd /c "\"\"C:\\Program Files\\NetBeans 8.0.1\\java\\maven\\bin\\mvn.bat\" -Drunfx.args=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=50991 -jar ${project.build.directory}/${project.build.finalName}.jar\" -Djpda.listen=true -DskipTests=true -Djpda.address=50991 -Dmaven.ext.class.path=C:\\Users\\Marcos\\AppData\\Roaming\\NetBeans\\8.0.1\\maven-nblib\\netbeans-eventspy.jar -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
      Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
      Scanning for projects...
  
      ------------------------------------------------------------------------
      Building **** 1.0-SNAPSHOT
      ------------------------------------------------------------------------
      The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
  
      --- exec-maven-plugin:1.2.1:exec (default-cli) @ **** ---
      Logging Provider: org.jboss.logging.Log4jLoggerProvider
      Adding type registration boolean -&gt; org.hibernate.type.BooleanType@601bc59e
      .....
      HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
      HHH000412: Hibernate Core {4.3.7.Final}
      HHH000206: hibernate.properties not found
      HHH000021: Bytecode provider name : javassist
      Registering IdentifierGenerator strategy [uuid2] -&gt; [org.hibernate.id.UUIDGenerator]
      Registering IdentifierGenerator strategy [guid] -&gt; [org.hibernate.id.GUIDGenerator]
      Registering IdentifierGenerator strategy [uuid] -&gt; [org.hibernate.id.UUIDHexGenerator]
      Registering IdentifierGenerator strategy [uuid.hex] -&gt; [org.hibernate.id.UUIDHexGenerator]
      Registering IdentifierGenerator strategy [hilo] -&gt; [org.hibernate.id.TableHiLoGenerator]
      Registering IdentifierGenerator strategy [assigned] -&gt; [org.hibernate.id.Assigned]
      Registering IdentifierGenerator strategy [identity] -&gt; [org.hibernate.id.IdentityGenerator]
      Registering IdentifierGenerator strategy [select] -&gt; [org.hibernate.id.SelectGenerator]
      Registering IdentifierGenerator strategy [sequence] -&gt; [org.hibernate.id.SequenceGenerator]
      Registering IdentifierGenerator strategy [seqhilo] -&gt; [org.hibernate.id.SequenceHiLoGenerator]
      Registering IdentifierGenerator strategy [increment] -&gt; [org.hibernate.id.IncrementGenerator]
      Registering IdentifierGenerator strategy [foreign] -&gt; [org.hibernate.id.ForeignGenerator]
      Registering IdentifierGenerator strategy [sequence-identity] -&gt; [org.hibernate.id.SequenceIdentityGenerator]
      Registering IdentifierGenerator strategy [enhanced-sequence] -&gt; [org.hibernate.id.enhanced.SequenceStyleGenerator]
      Registering IdentifierGenerator strategy [enhanced-table] -&gt; [org.hibernate.id.enhanced.TableGenerator]
      HHH000043: Configuring from resource: /hibernate.cfg.xml
      HHH000040: Configuration resource: /hibernate.cfg.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd] in classpath
      hibernate.dialect=org.hibernate.dialect.MySQLDialect
      hibernate.hikari.dataSourceClassName=com.mysql.jdbc.jdbc2.optional.MysqlDataSource
      hibernate.hikari.dataSource.url=jdbc:mysql://localhost:3307/****?zeroDateTimeBehavior=convertToNull
      hibernate.hikari.dataSource.user=****
      hibernate.hikari.dataSource.password=****1
      javax.persistence.validation.mode=none
      connection.release_mode=after_transaction
      current_session_context_class=thread
      show_sql=true
      format_sql=true
      hibernate.temp.use_jdbc_metadata_defaults=false
      hibernate.connection.provider_class=com.zaxxer.hikari.hibernate.HikariConnectionProvider
      hibernate.hikari.dataSource.cachePrepStmts=true
      hibernate.hikari.dataSource.prepStmtCacheSize=250
      hibernate.hikari.dataSource.prepStmtCacheSqlLimit=2048
      hibernate.hikari.dataSource.useServerPrepStmts=true
      hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
      hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
      hibernate.cache.use_second_level_cache=true
      hibernate.cache.use_query_cache=true
      net.sf.ehcache.configurationResourceName=/ehcache.xml
      Session-factory config [null] named resource [com/****/mapeos/****.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/****.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/****.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/********.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/********.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/****.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/****.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/********.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/********.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/****.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      Session-factory config [null] named resource [com/****/mapeos/****Categoria.hbm.xml] for mapping
      HHH000221: Reading mappings from resource: com/****/mapeos/****Categoria.hbm.xml
      Trying to resolve system-id [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd]
      Recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
      Located [http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd] in classpath
      HHH000041: Configured SessionFactory: null
      Properties: {java.vendor=Oracle Corporation, show_sql=true, sun.java.launcher=SUN_STANDARD, sun.management.compiler=HotSpot 64-Bit Tiered Compilers, os.name=Windows 8.1, sun.boot.class.path=C:\Program Files\Java\jdk1.8.0_40\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\rt.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_40\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_40\jre\classes, hibernate.temp.use_jdbc_metadata_defaults=false, hibernate.current_session_context_class=thread, sun.desktop=windows, java.vm.specification.vendor=Oracle Corporation, java.runtime.version=1.8.0_40-ea-b11, hibernate.hikari.dataSource.cachePrepStmts=true, hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider, user.name=Marcos, javax.persistence.validation.mode=none, hibernate.connection.release_mode=after_transaction, current_session_context_class=thread, javafx.runtime.version=8.0.40-ea-b11, user.language=es, hibernate.hikari.dataSource.prepStmtCacheSqlLimit=2048, sun.boot.library.path=C:\Program Files\Java\jdk1.8.0_40\jre\bin, hibernate.hikari.dataSource.prepStmtCacheSize=250, java.version=1.8.0_40-ea, user.timezone=Europe/Paris, sun.arch.data.model=64, java.endorsed.dirs=C:\Program Files\Java\jdk1.8.0_40\jre\lib\endorsed, sun.cpu.isalist=amd64, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, hibernate.format_sql=true, java.class.version=52.0, user.country=ES, java.home=C:\Program Files\Java\jdk1.8.0_40\jre, java.vm.info=mixed mode, os.version=6.3, path.separator=;, java.vm.version=25.40-b15, hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory, user.variant=, java.awt.printerjob=sun.awt.windows.WPrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, hibernate.javax.persistence.validation.mode=none, user.script=, user.home=C:\Users\Marcos, java.specification.vendor=Oracle Corporation, hibernate.hikari.dataSource.user=****, java.library.path=C:\Program Files\Java\jdk1.8.0_40\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\PHP\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_40\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Inno Setup 5;C:\Program Files (x86)\WiX Toolset v3.8\bin;C:\Program Files (x86)\MySQL\MySQL Utilities\;C:\Program Files (x86)\MySQL\MySQL Utilities\Doctrine extensions for PHP\;C:\cygwin64;D:\Servidor\bin\apache\apache2.2.22\bin;D:\Servidor\bin\php\php5.3.13;D:\Servidor\bin\php\php5.3.13\pear;D:\Servidor\bin\php\php5.3.13\imagick;D:\Servidor\tools\imagemagick\imagemagick6.8.9-7;D:\Servidor\tools\svn\svn1.7.14\bin;D:\Servidor\tools\git\git1.8.4\bin;;C:\Program Files (x86)\QuickTime\QTSystem\;., java.vendor.url=http://java.oracle.com/, java.vm.vendor=Oracle Corporation, hibernate.dialect=org.hibernate.dialect.MySQLDialect, java.runtime.name=Java(TM) SE Runtime Environment, sun.java.command=D:\****\Código\target/****-1.0-SNAPSHOT.jar, java.class.path=D:\****\Código\target/****-1.0-SNAPSHOT.jar, hibernate.net.sf.ehcache.configurationResourceName=/ehcache.xml, hibernate.bytecode.use_reflection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, hibernate.hikari.dataSource.password=****1, java.vm.specification.version=1.8, hibernate.cache.use_query_cache=true, sun.cpu.endian=little, hibernate.hikari.dataSource.url=jdbc:mysql://localhost:3307/****?zeroDateTimeBehavior=convertToNull, sun.os.patch.level=, hibernate.connection.provider_class=com.zaxxer.hikari.hibernate.HikariConnectionProvider, java.io.tmpdir=C:\Users\Marcos\AppData\Local\Temp\, java.vendor.url.bug=http://bugreport.sun.com/bugreport/, connection.release_mode=after_transaction, os.arch=amd64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=C:\Program Files\Java\jdk1.8.0_40\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, user.dir=D:\****\Código, line.separator=
      , java.vm.name=Java HotSpot(TM) 64-Bit Server VM, hibernate.hikari.dataSourceClassName=com.mysql.jdbc.jdbc2.optional.MysqlDataSource, hibernate.cache.use_second_level_cache=true, javafx.version=8.0.40-ea, file.encoding=Cp1252, format_sql=true, java.specification.version=1.8, net.sf.ehcache.configurationResourceName=/ehcache.xml, hibernate.hikari.dataSource.useServerPrepStmts=true, hibernate.show_sql=true}
      Adding Integrator [org.hibernate.cfg.beanvalidation.BeanValidationIntegrator].
      Adding Integrator [org.hibernate.secure.spi.JaccIntegrator].
      Adding Integrator [org.hibernate.cache.internal.CollectionCacheInvalidator].
      Registering named strategy selector [org.hibernate.dialect.Dialect] : [MySQL5] -&gt; [org.hibernate.dialect.MySQL5Dialect] (replacing [org.hibernate.dialect.MySQL5Dialect])
      Registering named strategy selector [org.hibernate.dialect.Dialect] : [MySQL5InnoDB] -&gt; [org.hibernate.dialect.MySQL5InnoDBDialect] (replacing [org.hibernate.dialect.MySQL5InnoDBDialect])
      Overriding existing service binding [org.hibernate.secure.spi.JaccService]
      Preparing to build session factory with filters : {}
      HHH000130: Instantiating explicit connection provider: com.zaxxer.hikari.hibernate.HikariConnectionProvider
      Configuring HikariCP
      HikariCP pool HikariPool-0 configuration:
      autoCommit......................true
      catalog.........................
      connectionCustomizer............com.zaxxer.hikari.HikariConfig$1@13fcc3f0
      connectionCustomizerClassName...
      connectionInitSql...............
      connectionTestQuery.............
      connectionTimeout...............30000
      dataSource......................
      dataSourceClassName.............com.mysql.jdbc.jdbc2.optional.MysqlDataSource
      dataSourceJNDI..................
      dataSourceProperties............{user=****, password=&lt;masked&gt;, url=jdbc:mysql://localhost:3307/****?zeroDateTimeBehavior=convertToNull, prepStmtCacheSqlLimit=2048, useServerPrepStmts=true, cachePrepStmts=true, prepStmtCacheSize=250}
      driverClassName.................
      idleTimeout.....................600000
      initializationFailFast..........false
      isolateInternalQueries..........false
      jdbc4ConnectionTest.............true
      jdbcUrl.........................
      leakDetectionThreshold..........0
      maxLifetime.....................1800000
      maximumPoolSize.................10
      metricsTrackerClassName.........com.zaxxer.hikari.metrics.CodaHaleMetricsTracker
      minimumIdle.....................10
      password........................&lt;masked&gt;
      poolName........................HikariPool-0
      readOnly........................false
      recordMetrics...................false
      registerMbeans..................false
      threadFactory...................
      transactionIsolation............
      username........................
      HikariCP pool HikariPool-0 is starting.
      HikariCP Configured
      HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
      HHH000422: Disabling contextual LOB creation as connection was null
      Processing hbm.xml files
      Mapping class: com.****.modelos.**** -&gt; ****
      Mapped property: id -&gt; Id
      .........
      Process annotated classes
      Processing fk mappings (*ToOne and JoinedSubclass)
      Processing extends queue
      Processing extends queue
      Processing collection mappings
      Second pass for collection: com.****.modelos.****.****s
      Mapping collection: com.****.modelos.****.****s -&gt; ****
      ..........
      Processing native query and ResultSetMapping mappings
      Processing association property references
      Creating tables' unique integer identifiers
      Processing foreign key constraints
      Resolving reference to class: com.****.modelos.****
      ............
      No JtaPlatform was specified, checking resolver
      No JtaPlatformResolver was specified, using default [org.hibernate.engine.transaction.jta.platform.internal.StandardJtaPlatformResolver]
      Could not resolve JtaPlatform, using default [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
      Automatic flush during beforeCompletion(): disabled
      Automatic session close at end of transaction: disabled
      Scrollable result sets: disabled
      Wrap result sets: disabled
      JDBC3 getGeneratedKeys(): disabled
      multi-tenancy strategy : NONE
      Connection release mode: after_transaction
      Using BatchFetchStyle : LEGACY
      Maximum outer join fetch depth: 2
      Default batch fetch size: 1
      Generate SQL with comments: disabled
      Order SQL updates by primary key: disabled
      Order SQL inserts for batching: disabled
      Default null ordering: none
      Query translator: org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory
      HHH000397: Using ASTQueryTranslatorFactory
      Query language substitutions: {}
      JPA-QL strict compliance: disabled
      Second-level cache: enabled
      Query cache: enabled
      Query cache factory: org.hibernate.cache.internal.StandardQueryCacheFactory
      Cache region factory : org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
      Optimize cache for minimal puts: enabled
      Structured second-level cache entries: disabled
      Second-level cache direct-reference entries: disabled
      Automatic eviction of collection cache: disabled
      Statistics: disabled
      Deleted entity synthetic identifier rollback: disabled
      Default entity-mode: pojo
      Named query checking : enabled
      Check Nullability in Core (should be disabled when Bean Validation is on): enabled
      Allow initialization of lazy state outside session : : disabled
      JTA Track by Thread: enabled
      Building session factory
      Exception in Application start method
      java.lang.reflect.InvocationTargetException
          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.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:363)
          at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:303)
          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 sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
      Caused by: java.lang.RuntimeException: Exception in Application start method
          at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
          at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$150(LauncherImpl.java:157)
          at com.sun.javafx.application.LauncherImpl$$Lambda$49/194494468.run(Unknown Source)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
          at com.****.dao.****DAO.obtenLista****esPorEstado(****DAO.java:92)
          at com.****.controladores.MainApp.start(MainApp.java:52)
          at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$156(LauncherImpl.java:821)
          at com.sun.javafx.application.LauncherImpl$$Lambda$52/718709938.run(Unknown Source)
          at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$169(PlatformImpl.java:326)
          at com.sun.javafx.application.PlatformImpl$$Lambda$46/863831416.run(Unknown Source)
          at com.sun.javafx.application.PlatformImpl.lambda$null$167(PlatformImpl.java:295)
          at com.sun.javafx.application.PlatformImpl$$Lambda$48/530599638.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          at com.sun.javafx.application.PlatformImpl.lambda$runLater$168(PlatformImpl.java:294)
          at com.sun.javafx.application.PlatformImpl$$Lambda$47/1508395126.run(Unknown Source)
          at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
          at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
          at com.sun.glass.ui.win.WinApplication.lambda$null$144(WinApplication.java:101)
          at com.sun.glass.ui.win.WinApplication$$Lambda$36/2136344592.run(Unknown Source)
          ... 1 more
      Exception running application com.****.controladores.MainApp
      ------------------------------------------------------------------------
      BUILD FAILURE
      ------------------------------------------------------------------------
      Total time: 8.154s
      Finished at: Sun Nov 09 16:50:23 CET 2014
      Final Memory: 7M/153M
      ------------------------------------------------------------------------
  </code></pre>
  
  <p>Part of hibernate.cfg.xml</p>
  
  <pre><code>    &lt;!-- Datos de conexión a la BD --&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3307/******?zeroDateTimeBehavior=convertToNull&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;****&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;****&lt;/property&gt;
      &lt;property name="javax.persistence.validation.mode"&gt;none&lt;/property&gt;
      &lt;!-- Configuración de sesión --&gt;
      &lt;property name="connection.release_mode"&gt;after_transaction&lt;/property&gt;
      &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
      &lt;!-- Configuración de la salida SQL y estadísticas --&gt;&gt;
      &lt;property name="show_sql"&gt;true&lt;/property&gt;
      &lt;property name="format_sql"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.temp.use_jdbc_metadata_defaults"&gt;false&lt;/property&gt;
      &lt;!-- Pool de conexiones  (works well)--&gt;
      &lt;property name="hibernate.connection.provider_class"&gt;com.zaxxer.hikari.hibernate.HikariConnectionProvider&lt;/property&gt;
      &lt;property name="hibernate.hikari.dataSource.cachePrepStmts"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.hikari.dataSource.prepStmtCacheSize"&gt;250&lt;/property&gt;
      &lt;property name="hibernate.hikari.dataSource.prepStmtCacheSqlLimit"&gt;2048&lt;/property&gt;
      &lt;property name="hibernate.hikari.dataSource.useServerPrepStmts"&gt;true&lt;/property&gt;
  
      &lt;!-- Cache 2º nivel  (this not work, but If disable, works)--&gt;
      &lt;property name="hibernate.cache.provider_class"&gt;org.hibernate.cache.EhCacheProvider&lt;/property&gt;
      &lt;property name="hibernate.cache.region.factory_class"&gt;org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory&lt;/property&gt;
      &lt;property name="hibernate.cache.use_second_level_cache"&gt;true&lt;/property&gt;
      &lt;property name="hibernate.cache.use_query_cache"&gt;true&lt;/property&gt;
      &lt;property name="net.sf.ehcache.configurationResourceName"&gt;/ehcache.xml&lt;/property&gt;
  </code></pre>
  
  <p>I don't know what it's wrong.</p>
  
  <p><strong>HibernateUtil.java</strong></p>
  
  <pre><code>public enum HibernateUtil {
  
      INSTANCE;
      private final SessionFactory sessionFactory;
  
      private HibernateUtil() {
          Configuration configuration;
          StandardServiceRegistryBuilder builder;
  
          configuration = new Configuration().configure();
  
          builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
          sessionFactory = configuration.buildSessionFactory(builder.build());
      }
  
      public static HibernateUtil getInstance() {
          return INSTANCE;
      }
  
      public SessionFactory getSessionFactory() {
          return sessionFactory;
      }
  
  }
  </code></pre>
  
  <p><strong>POM</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
     ......
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;terracotta-releases&lt;/id&gt;
              &lt;url&gt;http://www.terracotta.org/download/reflector/releases&lt;/url&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-ehcache&lt;/artifactId&gt;
              &lt;version&gt;4.3.7.Final&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
                      &lt;artifactId&gt;ehcache-core&lt;/artifactId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
              &lt;artifactId&gt;ehcache&lt;/artifactId&gt;
              &lt;version&gt;2.9.0&lt;/version&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;!-- MySQL --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.33&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Apache Log4j --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Hibernate --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;4.3.7.Final&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;4.3.7.Final&lt;/version&gt;
          &lt;/dependency&gt;        
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.common&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-commons-annotations&lt;/artifactId&gt;
              &lt;version&gt;4.0.5.Final&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
              &lt;version&gt;1.0.0.Final&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.logging&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-logging&lt;/artifactId&gt;
              &lt;version&gt;3.1.4.GA&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;!-- Logs --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;1.7.7&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;dom4j&lt;/groupId&gt;
              &lt;artifactId&gt;dom4j&lt;/artifactId&gt;
              &lt;version&gt;1.6.1&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;xml-apis&lt;/groupId&gt;
              &lt;artifactId&gt;xml-apis&lt;/artifactId&gt;
              &lt;version&gt;2.0.2&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;antlr&lt;/groupId&gt;
              &lt;artifactId&gt;antlr&lt;/artifactId&gt;
              &lt;version&gt;2.7.7&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.javassist&lt;/groupId&gt;
              &lt;artifactId&gt;javassist&lt;/artifactId&gt;
              &lt;version&gt;3.18.2-GA&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.logging&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-logging-annotations&lt;/artifactId&gt;
              &lt;version&gt;1.2.0.Final&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.spec.javax.transaction&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-transaction-api_1.2_spec&lt;/artifactId&gt;
              &lt;version&gt;1.0.0.Final&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
              &lt;type&gt;jar&lt;/type&gt;
          &lt;/dependency&gt;
          &lt;!-- Pool de conexiones --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.zaxxer&lt;/groupId&gt;
              &lt;artifactId&gt;HikariCP&lt;/artifactId&gt;
              &lt;version&gt;2.1.0&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.7.7&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>UPDATE: I add files configuration for more info.</p>