title: spring boot + hibernate 5 + java 8 + ZonedDateTime = ImplicitNamingStrategy exception
body: <p>I have an spring boot app that leverage the java 8 and have used hibernate 4 so far. I needed however to change part of my model to include the new ZonedDateTime class provided by java8 i.e. I needed a datatime type that provide me the instance of time in utc together with the offset and the time zone. For that reason i wanted to have the native hibernate 5 support. I have replaced in my pom the the parts:</p>
  
  <pre><code>    //&lt;dependency&gt;
      //  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      //  &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
      //  &lt;version&gt;4.3.10.Final&lt;/version&gt;
      //&lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-java8&lt;/artifactId&gt;
          &lt;version&gt;5.0.0.CR2&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>and i have changed in my SpringPercisence confguration class to use the hibernate 5 instead of hibernate 4 i.e. </p>
  
  <pre><code>    @Bean
      public org.springframework.orm.hibernate5.LocalSessionFactoryBean sessionFactory() {
  
  //      org.springframework.orm.hibernate4.LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
          org.springframework.orm.hibernate5.LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
  
          sessionFactory.setDataSource(this.dataSource());
          sessionFactory.setPackagesToScan("org.test");
          sessionFactory.setHibernateProperties(hibernateProperties());
  
          return sessionFactory;
      }
  
  
  
         @Bean
  //     public org.springframework.orm.hibernate4.HibernateTransactionManager transactionManager() {
         public org.springframework.orm.hibernate5.HibernateTransactionManager transactionManager() {
            HibernateTransactionManager txManager = new HibernateTransactionManager();
            txManager.setSessionFactory(sessionFactory().getObject());
  
            return txManager;
         }
  
         @Bean
         public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
            return new PersistenceExceptionTranslationPostProcessor();
         }
  
  
          @Bean
          public  Properties hibernateProperties() {
            return new Properties() {
  
  
              {
                  setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
                  setProperty("hibernate.chach.provider_class", "org.hibernate.cache.NoCacheProvider");
                  setProperty("hibernate.show_sql", "true");              
  //              setProperty("hibernate.hbm2ddl.auto", "create");
                  setProperty("hibernate.hbm2ddl.auto", "create-drop");
  
  //              setProperty("hibernate.hbm2ddl.auto", "update");
  
               }
            };
         }
  </code></pre>
  
  <p>I am getting an error that is somehow related to the "sessionFactory" bean that configured above, and later it says something about ImplicitNamingStrategy. I have read here </p>
  
  <p><a href="http://in.relation.to/2015/03/31/hibernate-orm-500-beta-1-release/" rel="nofollow">http://in.relation.to/2015/03/31/hibernate-orm-500-beta-1-release/</a></p>
  
  <p>that hibernate NamingStrategy has been removed but i do not understand what exactlly that mean. Since i was not able to find an example of hibernat and spring4 i hope that someone could help me out here with this one.</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Failed to introspect bean class [org.springframework.orm.hibernate5.LocalSessionFactoryBean] for persistence metadata: could not find class that it depends on
      at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:396)
      at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:333)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:935)
      ... 70 common frames omitted
  Caused by: java.lang.NoClassDefFoundError: Lorg/hibernate/boot/model/naming/ImplicitNamingStrategy;
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2575)
      at java.lang.Class.getDeclaredFields(Class.java:1908)
      at org.springframework.util.ReflectionUtils.getDeclaredFields(ReflectionUtils.java:707)
      at org.springframework.util.ReflectionUtils.doWithLocalFields(ReflectionUtils.java:649)
      at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.buildPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:413)
      at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:392)
      ... 72 common frames omitted
  Caused by: java.lang.ClassNotFoundException: org.hibernate.boot.model.naming.ImplicitNamingStrategy
      at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 79 common frames omitted
  </code></pre>
  
  <p>Addition 16 July 2015: including full pom:</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;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;1.3.0.M2&lt;/version&gt;
      &lt;/parent&gt;
  
  
      &lt;groupId&gt;test&lt;/groupId&gt;
      &lt;artifactId&gt;TestProject&lt;/artifactId&gt;
      &lt;name&gt;TestProject&lt;/name&gt;
  
  
      &lt;dependencies&gt;          
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-java8&lt;/artifactId&gt;
              &lt;version&gt;${hibernate5Java8}&lt;/version&gt;
          &lt;dependency&gt; --&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
  &lt;!--            &lt;version&gt;9.3-1102-jdbc41&lt;/version&gt; --&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.validation&lt;/groupId&gt;
              &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
              &lt;version&gt;1.1.0.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
              &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-messaging&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf-spring4&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-websocket&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-embed-core&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.tomcat.embed&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-embed-websocket&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;           
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-websocket&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.thymeleaf.extras&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf-extras-springsecurity4&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;nz.net.ultraq.thymeleaf&lt;/groupId&gt;
              &lt;artifactId&gt;thymeleaf-layout-dialect&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.h2database&lt;/groupId&gt;
              &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;net.wimpi&lt;/groupId&gt;
              &lt;artifactId&gt;telnetd-x&lt;/artifactId&gt;
              &lt;version&gt;2.1.1&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-remote-shell&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
              &lt;groupId&gt;com.github.axet&lt;/groupId&gt;
              &lt;artifactId&gt;kaptcha&lt;/artifactId&gt;
              &lt;version&gt;0.0.9&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-remote-shell&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jadira.usertype&lt;/groupId&gt;
              &lt;artifactId&gt;usertype.core&lt;/artifactId&gt;
              &lt;version&gt;3.2.0.GA&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-jndi&lt;/artifactId&gt;
              &lt;version&gt;8.1.14.v20131031&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
              &lt;artifactId&gt;spring-data-redis&lt;/artifactId&gt;
              &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;redis.clients&lt;/groupId&gt;
              &lt;artifactId&gt;jedis&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-batch&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jasypt&lt;/groupId&gt;
              &lt;artifactId&gt;jasypt&lt;/artifactId&gt;
              &lt;version&gt;1.9.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jolokia&lt;/groupId&gt;
              &lt;artifactId&gt;jolokia-core&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-amqp&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
              &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
              &lt;version&gt;2.10.4&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectreactor&lt;/groupId&gt;
              &lt;artifactId&gt;reactor-core&lt;/artifactId&gt;
              &lt;version&gt;1.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectreactor&lt;/groupId&gt;
              &lt;artifactId&gt;reactor-net&lt;/artifactId&gt;
              &lt;version&gt;1.1.6.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectreactor&lt;/groupId&gt;
              &lt;artifactId&gt;reactor-tcp&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.projectreactor&lt;/groupId&gt;
              &lt;artifactId&gt;reactor-spring&lt;/artifactId&gt;
              &lt;version&gt;1.0.1.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
  
  
          &lt;dependency&gt;
            &lt;groupId&gt;junit&lt;/groupId&gt;
            &lt;artifactId&gt;junit&lt;/artifactId&gt;
            &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;   
  
  
  
        &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;  
        &lt;/dependency&gt;
  
  
  
        &lt;dependency&gt;
          &lt;groupId&gt;net.sf.ehcache&lt;/groupId&gt;
          &lt;artifactId&gt;ehcache-core&lt;/artifactId&gt;
          &lt;version&gt;2.4.3&lt;/version&gt;
        &lt;/dependency&gt;
  
        &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpamodelgen&lt;/artifactId&gt;
        &lt;/dependency&gt;
      &lt;/dependencies&gt;     
  
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;build&gt;
          &lt;defaultGoal&gt;test&lt;/defaultGoal&gt;
          &lt;plugins&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
  
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
  
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
  &lt;!--                &lt;version&gt;2.18.1&lt;/version&gt; --&gt;
                  &lt;configuration&gt;
                      &lt;useSystemClassLoader&gt;false&lt;/useSystemClassLoader&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
  
          &lt;/plugins&gt;
  
  
  
      &lt;/build&gt;
  
  
  
    &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
          &lt;id&gt;spring-releases&lt;/id&gt;
          &lt;name&gt;Spring Releases&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
          &lt;id&gt;spring-snapshot&lt;/id&gt;
          &lt;url&gt;https://repo.spring.io/libs-snapshot&lt;/url&gt;
      &lt;/repository&gt;
  
  &lt;/repositories&gt;
  
      &lt;pluginRepositories&gt;
          &lt;pluginRepository&gt;
              &lt;id&gt;spring-snapshots&lt;/id&gt;
              &lt;url&gt;http://repo.spring.io/libs-snapshot&lt;/url&gt;
              &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
          &lt;/pluginRepository&gt;
  
  &lt;!--         &lt;pluginRepository&gt; --&gt;
  &lt;!--            &lt;id&gt;spring-milestones&lt;/id&gt; --&gt;
  &lt;!--            &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt; --&gt;
  &lt;!--        &lt;/pluginRepository&gt; --&gt;
  
          &lt;pluginRepository&gt;
              &lt;id&gt;spring-releases&lt;/id&gt;
              &lt;name&gt;Spring Releases&lt;/name&gt;
              &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
          &lt;/pluginRepository&gt;
  
      &lt;/pluginRepositories&gt;
  
      &lt;properties&gt;
          &lt;java-version&gt;1.8&lt;/java-version&gt;
  &lt;!--        &lt;spring-version&gt;4.1.6.RELEASE&lt;/spring-version&gt; --&gt;
  &lt;!--        &lt;spring-version&gt;4.2.0.RC1&lt;/spring-version&gt; --&gt;
          &lt;org.aspectj-version&gt;1.6.10&lt;/org.aspectj-version&gt;
          &lt;org.slf4j-version&gt;1.7.6&lt;/org.slf4j-version&gt;
          &lt;start-class&gt;org.TestProject.core.Application&lt;/start-class&gt;
  &lt;!--        &lt;springBootVersion&gt;1.1.7.RELEASE&lt;/springBootVersion&gt; --&gt;
          &lt;springBootVersion&gt;1.2.4.RELEASE&lt;/springBootVersion&gt; 
          &lt;tomcat.version&gt;8.0.5&lt;/tomcat.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;hibernate5Java8&gt;5.0.0.CR2&lt;/hibernate5Java8&gt;
          &lt;spring.data.redis&gt;1.4.1.RELEASE&lt;/spring.data.redis&gt;
          &lt;jedis&gt;2.6.1&lt;/jedis&gt;
          &lt;spring-security.version&gt;4.0.2.CI-SNAPSHOT&lt;/spring-security.version&gt;
      &lt;/properties&gt;
  
  
  
  &lt;/project&gt;
  </code></pre>