title: EclipseLink "No Persistence provider for EntityManager named ..." exception
body: <p>I'm trying to create a simple Java app, using JPA to communicate with a MySQL database, that allows me to insert new rows into the tables found in the database, retrieve the data inside them, etc. But when I try running it, I get this error:</p>
  <pre><code>Exception in thread &quot;main&quot; javax.persistence.PersistenceException: No Persistence provider for EntityManager named default
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:85)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:54)
      at com.lab9.Main.main(Main.java:9)
  </code></pre>
  <p>I know this question has already been asked a few times on here, but none of the older threads have been of any help to me. Usually, people seem to get this exception because they have their <code>persistence.xml</code> file in the wrong directory, or because they forgot to specify a <code>&lt;provider&gt;</code> in said file, neither of which is the case for me. This is what my project structure looks like in IntelliJ:
  <br>
  <a href="https://i.stack.imgur.com/5fYMj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5fYMj.png" alt="enter image description here" /></a></p>
  <p>As you can see, I have <code>persistence.xml</code> in <code>src/main/resources/META-INF</code>, where it's supposed to be. Inside this file, I have this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
  &lt;persistence xmlns=&quot;https://jakarta.ee/xml/ns/persistence&quot;
               xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
               xsi:schemaLocation=&quot;https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd&quot;
               version=&quot;3.0&quot;&gt;
      &lt;persistence-unit name=&quot;default&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
          &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
          &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
          &lt;class&gt;com.lab9.Continent&lt;/class&gt;
          &lt;properties&gt;
              &lt;property name=&quot;javax.persistence.jdbc.driver&quot; value=&quot;com.mysql.jdbc.Driver&quot;/&gt;
              &lt;property name=&quot;javax.persistence.jdbc.url&quot; value=&quot;jdbc:mysql://localhost:3306/cities&quot;/&gt;
              &lt;property name=&quot;javax.persistence.jdbc.user&quot; value=&quot;root&quot;/&gt;
              &lt;property name=&quot;javax.persistence.jdbc.password&quot; value=&quot;&quot;/&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  <p>And finally, in my <code>pom.xml</code> file, I added these dependencies:</p>
  <pre><code>&lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
          &lt;version&gt;3.0.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;javax.persistence&lt;/artifactId&gt;
          &lt;version&gt;2.1.0&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;8.0.28&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  <p>I've tried pretty much everything: moving files around, adding and deleting dependencies, re-writing the whole program from scratch, yet nothing seems to work.</p>