title: stacktrace after hibernate upgrade with respect to ehcache configuration
body: <p>I've upgraded hibernate from version 5.0.1.Final to 5.3.4.Final
  I've also upgraded ehcache to version 3.5.2</p>
  
  <p>in my spring context I've got the following properties set for hibernate</p>
  
  <pre><code>    &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.show_sql"&gt;${hibernate.show.sql:false}&lt;/prop&gt;
              &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.use_sql_comments"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.generate_statistics"&gt;false&lt;/prop&gt;
              &lt;prop key="hibernate.jdbc.batch_versioned_data"&gt;false&lt;/prop&gt;
              &lt;prop key="hibernate.connection.release_mode"&gt;${hibernate.connection.release.strategy:after_statement}&lt;/prop&gt;
              &lt;prop key="hibernate.javax.cache.missing_cache_strategy"&gt;create-warn&lt;/prop&gt;
              &lt;prop key="hibernate.javax.cache.provider"&gt;org.ehcache.jsr107.EhcacheCachingProvider&lt;/prop&gt;
              &lt;prop key="hibernate.javax.cache.uri"&gt;classpath:ehcache.xml&lt;/prop&gt;
              &lt;prop key="hibernate.cache.use_second_level_cache"&gt;${hibernate.use.second.level.cache:true}&lt;/prop&gt;
              &lt;prop key="hibernate.cache.use_query_cache"&gt;${hibernate.use.query.cache:true}&lt;/prop&gt;
              &lt;prop key="hibernate.cache.region.factory_class"&gt;jcache&lt;/prop&gt;
              &lt;prop key="hibernate.transaction.coordinator_class"&gt;jta&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  </code></pre>
  
  <p>my ehacahce.xml is somthing like</p>
  
  <pre><code>&lt;config
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
      xmlns='http://www.ehcache.org/v3'
      xmlns:jsr107='http://www.ehcache.org/v3/jsr107'
      xsi:schemaLocation="
      http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.0.xsd
      http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.0.xsd"&gt;
  
  &lt;service&gt;
      &lt;jsr107:defaults enable-management="false" enable-statistics="false"&gt;
          &lt;jsr107:cache name="otherCache" template="otherCacheTemplate1"/&gt;
          &lt;jsr107:cache name="otherCache" template="otherCacheTemplate2"/&gt;
      &lt;/jsr107:defaults&gt;
  &lt;/service&gt;
  
  &lt;cache-template name="defaultCacheTemplate"&gt;
      &lt;expiry&gt;
          &lt;ttl unit="minutes"&gt;10&lt;/ttl&gt;
      &lt;/expiry&gt;
      &lt;heap&gt;1000&lt;/heap&gt;
  &lt;/cache-template&gt;
  
  &lt;cache-template name="otherCacheTemplate1"&gt;
      &lt;key-type&gt;java.lang.String&lt;/key-type&gt;
      &lt;value-type&gt;nl.company.product.domain.OtherClass1&lt;/value-type&gt;
      &lt;expiry&gt;
          &lt;ttl unit="minutes"&gt;10&lt;/ttl&gt;
      &lt;/expiry&gt;
      &lt;heap&gt;1000&lt;/heap&gt;
  &lt;/cache-template&gt;
  
  &lt;cache-template name="otherCacheTemplate2"&gt;
      &lt;key-type&gt;java.lang.String&lt;/key-type&gt;
      &lt;value-type&gt;nl.company.product.domain.OtherClass2&lt;/value-type&gt;
      &lt;expiry&gt;
          &lt;ttl unit="minutes"&gt;10&lt;/ttl&gt;
      &lt;/expiry&gt;
      &lt;heap&gt;1000&lt;/heap&gt;
  &lt;/cache-template&gt;
  
  &lt;/config&gt;
  </code></pre>
  
  <p>When I start up the application I see the following stacktrace</p>
  
  <pre><code>     2018-08-15 17:02:49,025 [DASHBOARD][WARN ][RMI TCP Connection(2)-127.0.0.1] o.h.o.cache.createCache:107 - HHH90001006: Missing cache[default-update-timestamps-region] was created on-the-fly. The created cache will use a provider-specific default configuration: make sure you defined one. You can disable this warning by setting 'hibernate.javax.cache.missing_cache_strategy' to 'create'. 
       2018-08-15 17:02:49,144 [DASHBOARD][WARN ][RMI TCP Connection(2)-127.0.0.1] o.s.w.c.s.XmlWebApplicationContext.refresh:551 - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbOtherClass1Dao': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/persistenceContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.CacheImplementor] 
   15-Aug-2018 17:02:49.228 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
   2018-08-15 17:02:49,226 [DASHBOARD][ERROR][RMI TCP Connection(2)-127.0.0.1] o.s.w.c.ContextLoader.initWebApplicationContext:350 - Context initialization failed 
   org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dbOtherClass1Dao': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/persistenceContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.CacheImplementor]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
   15-Aug-2018 17:02:49.233 SEVERE [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [/dashboard] startup failed due to previous errors
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1272) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325) ~[spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745) [catalina.jar:8.5.23]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207) [catalina.jar:8.5.23]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.23]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) [catalina.jar:8.5.23]
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) [catalina.jar:8.5.23]
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.23]
        at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1739) [catalina.jar:8.5.23]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) [tomcat-coyote.jar:8.5.23]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.8.0_151]
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_151]
        at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482) [catalina.jar:8.5.23]
        at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431) [catalina.jar:8.5.23]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
        at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) [tomcat-coyote.jar:8.5.23]
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) [na:1.8.0_151]
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) [na:1.8.0_151]
        at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) [na:1.8.0_151]
        at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) [na:1.8.0_151]
        at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) [na:1.8.0_151]
        at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) [na:1.8.0_151]
        at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) [na:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) [na:1.8.0_151]
        at sun.rmi.transport.Transport$1.run(Transport.java:200) [na:1.8.0_151]
        at sun.rmi.transport.Transport$1.run(Transport.java:197) [na:1.8.0_151]
        at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_151]
        at sun.rmi.transport.Transport.serviceCall(Transport.java:196) [na:1.8.0_151]
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) [na:1.8.0_151]
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) [na:1.8.0_151]
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) [na:1.8.0_151]
        at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_151]
        at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) [na:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_151]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_151]
        at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_151]
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [META-INF/persistenceContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.CacheImplementor]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1634) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        ... 60 common frames omitted
   Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.CacheImplementor]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(SessionFactoryServiceRegistryImpl.java:109) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:239) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.springframework.orm.hibernate5.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:511) ~[spring-orm-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:495) ~[spring-orm-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1692) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630) ~[spring-beans-4.3.18.RELEASE.jar:4.3.18.RELEASE]
        ... 70 common frames omitted
   Caused by: org.ehcache.jsr107.MultiCacheException: [Exception 0] org.terracotta.statistics.StatisticsManager.createPassThroughStatistic(Ljava/lang/Object;Ljava/lang/String;Ljava/util/Set;Lorg/terracotta/statistics/StatisticType;Ljava/util/function/Supplier;)V
        at org.ehcache.jsr107.Eh107CacheManager.createCache(Eh107CacheManager.java:202) ~[ehcache-3.5.2.jar:3.5.2 7941fa2573343b31ae56a12564404552c6d6eff0]
        at org.hibernate.cache.jcache.internal.JCacheRegionFactory.createCache(JCacheRegionFactory.java:111) ~[hibernate-jcache-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.cache.jcache.internal.JCacheRegionFactory.getOrCreateCache(JCacheRegionFactory.java:98) ~[hibernate-jcache-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.cache.jcache.internal.JCacheRegionFactory.createTimestampsRegionStorageAccess(JCacheRegionFactory.java:155) ~[hibernate-jcache-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.cache.spi.support.RegionFactoryTemplate.buildTimestampsRegion(RegionFactoryTemplate.java:70) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.cache.internal.EnabledCaching.&lt;init&gt;(EnabledCaching.java:80) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:33) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:24) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.service.spi.SessionFactoryServiceInitiator.initiateService(SessionFactoryServiceInitiator.java:30) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:68) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263) ~[hibernate-core-5.3.4.Final.jar:5.3.4.Final]
        ... 81 common frames omitted
   15-Aug-2018 17:02:49.301 WARNING [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [dashboard] registered the JDBC driver [com.sybase.jdbc4.jdbc.SybDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
   [2018-08-15 05:02:49,338] Artifact dashboard-war:war exploded: Error during artifact deployment. See server log for details.
  </code></pre>
  
  <p>So what am I doing wrong here?</p>