title: exception javax.persistence.PersistenceException problem
body: <p>(Excuse me for my english I'm a little frenchie).
  I'm new in Java ee and wanted to put a JPA ORM.
  I tried and thought I was doing fine exept when I launched it on my Glassfish server. I had : javax.persistence.PersistenceException: No Persistence provider for EntityManager named test Exception.
  I know that's it's a quite common error but I tried so many things. I don't know where the problem is...
  Here's some of my code :
  Article bean :</p>
  <pre><code>package beans;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  @Entity
  @Table(name = &quot;T_Articles&quot;)
  public class Article {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private int idArticle;
  
      private String description;
  
      private String brand;
  
      @Column(name = &quot;UnitaryPrice&quot;)
      private double price;
  
      public Article() {
          this(&quot;unknown&quot;, &quot;unknown&quot;, 0);
      }
  
      public Article(String description, String brand, double price) {
          this.setDescription(description);
          this.setBrand(brand);
          this.setPrice(price);
      }
  
      public int getIdArticle() {
          return idArticle;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public String getBrand() {
          return brand;
      }
  
      public void setBrand(String brand) {
          this.brand = brand;
      }
  
      public double getPrice() {
          return price;
      }
  
      public void setPrice(double price) {
          this.price = price;
      }
  
      @Override
      public String toString() {
          return &quot;Article [idArticle=&quot; + idArticle + &quot;, description=&quot; + description + &quot;, brand=&quot; + brand + &quot;, price=&quot;
                  + price + &quot;]&quot;;
      }
  
  }
  </code></pre>
  <p>My persistence.xml :</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;persistence version=&quot;1.0&quot; xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot;&gt;
      &lt;persistence-unit name=&quot;test&quot;&gt;
              &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;
          &lt;class&gt;beans.Article&lt;/class&gt;
          &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
  
          &lt;properties&gt;
          
              &lt;property name=&quot;hibernate.archive.autodetection&quot; value=&quot;class&quot;/&gt;
              &lt;property name=&quot;hibernate.connection.driver_class&quot; value=&quot;com.mysql.jdbc.Driver&quot;/&gt;
              &lt;property name=&quot;hibernate.connection.url&quot; value=&quot;jdbc:mysql://localhost:3306/bddtest&quot;/&gt;
              &lt;property name=&quot;hibernate.connection.username&quot; value=&quot;root&quot;/&gt;
              &lt;property name=&quot;hibernate.connection.password&quot; value=&quot;root&quot;/&gt;
              &lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.MySQLDialect&quot;/&gt;
              &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot;/&gt;
              &lt;property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;create-drop&quot;/&gt;
  
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  
  &lt;/persistence&gt;
  </code></pre>
  <p>My servlet using it :</p>
  <pre><code>package servlets;
  
  import java.io.IOException;
  
  import javax.persistence.EntityManager;
  import javax.persistence.EntityManagerFactory;
  import javax.persistence.Persistence;
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import beans.Article;
  
  /**
   * Servlet implementation class aaa
   */
  @WebServlet(&quot;/aaa&quot;)
  public class aaa extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      /**
       * @see HttpServlet#HttpServlet()
       */
      public aaa() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
       *      response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          // TODO Auto-generated method stub
          EntityManagerFactory emf = Persistence.createEntityManagerFactory(&quot;test&quot;);
          EntityManager em = emf.createEntityManager();
          Article c;
          c = new Article();
  
          em.getTransaction().begin();
          em.persist(c);
          em.getTransaction().commit();
  
          em.close();
          emf.close();
      }
  
      /**
       * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
       *      response)
       */
      protected void doPost(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
          // TODO Auto-generated method stub
          doGet(request, response);
      }
  
  }
  </code></pre>
  <p>My file hierarchy :
  <a href="https://i.stack.imgur.com/oh7fu.png" rel="nofollow noreferrer">My file hierarchy</a></p>
  <p>I don't know how to fix it can u help me ? :(</p>
  <p>Thanks,
  A Java EE newbie</p>