title: How to solve AbstractMethodError in Hibernate 5?
body: <p>i'm trying to use the hibernate 5 in Java EE with tomcat 7, and i'm getting this error:</p>
  
  <pre><code>java.lang.AbstractMethodError
  org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:278)
  org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
  org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)
  org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58)
  javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
  javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
  controller.dao.GenericDAO.&lt;clinit&gt;(GenericDAO.java:28)
  com.mycompany.mazkrest.UsuarioResource.login(UsuarioResource.java:89)
  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  java.lang.reflect.Method.invoke(Method.java:483)
  org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
  org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
  org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
  org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:205)
  org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
  org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
  org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
  org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
  org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:309)
  org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
  org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
  org.glassfish.jersey.internal.Errors.process(Errors.java:315)
  org.glassfish.jersey.internal.Errors.process(Errors.java:297)
  org.glassfish.jersey.internal.Errors.process(Errors.java:267)
  org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
  org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:292)
  org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1139)
  org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:460)
  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)
  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)
  org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  </code></pre>
  
  <p>I'm using JPA 2.1, I've deleted any jars of old jpa versions.</p>
  
  <p>Here is my dependencies in pom.xml:</p>
  
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.containers&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-container-servlet-core&lt;/artifactId&gt;
          &lt;!-- &lt;version&gt;${jersey.version}&lt;/version&gt;--&gt;
          &lt;!-- use the following artifactId if you don't need servlet 2.x compatibility --&gt;
          &lt;!-- artifactId&gt;jersey-container-servlet&lt;/artifactId --&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.6&lt;/version&gt;
      &lt;/dependency&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.36&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
          &lt;version&gt;2.6.1&lt;/version&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;version&gt;2.6.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.jaxrs&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-jaxrs-json-provider&lt;/artifactId&gt;
          &lt;version&gt;2.6.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.voodoodyne.jackson.jsog&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-jsog&lt;/artifactId&gt;
          &lt;version&gt;1.1&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
          &lt;version&gt;2.6.1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.media&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-media-json-jackson&lt;/artifactId&gt;
          &lt;!--  &lt;version&gt;${jersey.version}&lt;/version&gt;--&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-search&lt;/artifactId&gt;
          &lt;version&gt;5.3.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
          &lt;version&gt;5.3.0&lt;/version&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;5.0.1.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt;
          &lt;version&gt;7.0&lt;/version&gt;
          &lt;type&gt;jar&lt;/type&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>When i execute the code that throws the exception for the second time, i get a NoDefClassFoundError.</p>
  
  <p>The hibernate seems booting right in the log, but isn't creating the entity manager.</p>
  
  <p>How solve this?</p>