title: Problem with org.hibernate.jpa.HibernatePersistenceProvider
body: <p>I have problem with creating a persistence context using annotation. Where is the problem?</p>
  
  <p>I've tried to use another versions</p>
  
  <pre><code>import javax.ejb.EJB;
  import javax.ejb.Singleton;
  import javax.ejb.Stateful;
  import javax.ejb.Stateless;
  import javax.enterprise.context.ApplicationScoped;
  import javax.inject.Inject;
  import javax.persistence.*;
  import java.util.List;
  @Stateful
  public class UserService {
  @PersistenceContext(unitName = "JPAUNIT", type = PersistenceContextType.EXTENDED)
  private EntityManager em;
  
  public boolean saveUsr(User user){
      em.getTransaction().begin();
      try {
          em.persist(user);
          em.getTransaction().commit();
          return true;
      }catch (Exception e){
          System.out.println("User exists");
          return false;
      }
  }
  //other methods
  }
  </code></pre>
  
  <p>persistence.xml</p>
  
  <pre><code>    &lt;persistence-unit name="JPAUNIT"&gt;
                  &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
  
      &lt;class&gt;classes&lt;/class&gt;
  
      &lt;properties&gt;
          &lt;property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/points"/&gt;
          &lt;property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/&gt;
          &lt;property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL9Dialect"/&gt;
          &lt;property name="hibernate.connection.username" value="postgres"/&gt;
          &lt;property name="hibernate.connection.password" value="1234"/&gt;
      &lt;/properties&gt;
  
  &lt;/persistence-unit&gt;
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>    &lt;packaging&gt;war&lt;/packaging&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;42.2.5&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
          &lt;version&gt;5.3.7.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-jpa-2.2-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.Beta2&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.3.7.Final&lt;/version&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.25&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
          &lt;version&gt;1.19.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
          &lt;version&gt;1.8&lt;/version&gt;
      &lt;/dependency&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;version&gt;2.27&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.8.0&lt;/version&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;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>StackTrace</p>
  
  <p>Exception while preparing the app : java.lang.ClassNotFoundException:     org.hibernate.jpa.HibernatePersistenceProvider
       java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1621)
      at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1471)
      at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:164)
      at org.glassfish.persistence.jpa.PersistenceUnitLoader.(PersistenceUnitLoader.java:107)
      at org.glassfish.persistence.jpa.JPADeployer$1.visitPUD(JPADeployer.java:223)
      at org.glassfish.persistence.jpa.JPADeployer$PersistenceUnitDescriptorIterator.iteratePUDs(JPADeployer.java:510)
      at org.glassfish.persistence.jpa.JPADeployer.createEMFs(JPADeployer.java:230)</p>
  
  <p><strong>Updated:</strong> 
  Tried to use another versions as @SteveC said, but it didn't solve this</p>
  
  <p>Added stack trace and pom.xml</p>