title: No Persistence provider for EntityManager named X
body: <p>I am developing a JavaSE application using JPA. Unfortunately, I get <code>null</code> after calling:
  <code>Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);</code></p>
  
  <p>Below you will find:</p>
  
  <ul>
  <li>A snippet of my code that invokes <code>EntityManagerFactory</code> and unexpectedly returns <code>null</code></li>
  <li>My <code>persistence.xml</code> file</li>
  <li>My project structure</li>
  </ul>
  
  <p><strong>Snippet of my code:</strong></p>
  
  <pre><code>public class Main {
      private static final String PERSISTENCE_UNIT_NAME = "MeineJpaPU";
      private static EntityManagerFactory factory;
  
      public static void main(String[] args) {
          // I get null on this line!!!
         factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
  
         EntityManager em = factory.createEntityManager();
         // do stuff with entity manager
         ...
      }
  }
  </code></pre>
  
  <p><strong>My persistence.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="1.0"
      xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                          http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
    &lt;persistence-unit name="MeineJpaPU" transaction-type="RESOURCE_LOCAL"&gt;
      &lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
      &lt;class&gt;path.to.package.server.Todo&lt;/class&gt;
        &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
       &lt;properties&gt;       
              &lt;property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/&gt;       
              &lt;property name="javax.persistence.jdbc.url"  value="jdbc:postgresql://localhost:5432/test"/&gt;       
              &lt;property name="javax.persistence.jdbc.user" value="postgres"/&gt;       
              &lt;property name="javax.persistence.jdbc.password" value="postgres"/&gt;       
          &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p><strong>My project structure:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/isoO8.jpg" alt="This is the structure of my project:"></p>