title: Class name is wrong or classpath is not set ERROR in Netbeans with Glassfish 5 server and JPAs
body: <p>I have a Web Application in Netbeans 11 (with JDK 8 installed), I have added the dependencies for mysql-connector-java-8.0.15.jar and I have generated the JPAs from my DB.</p>
  <p>No error while building it.</p>
  <p>But when I try to run it, the Glassfish server give me these <a href="https://pastebin.com/BS0u32wk" rel="nofollow noreferrer">errors (pastebin link)</a>.</p>
  <p>This is my persistence.xml, that I set accordingly, is:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;persistence version=&quot;2.1&quot; xmlns=&quot;http://xmlns.jcp.org/xml/ns/persistence&quot; 
  xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; 
  xsi:schemaLocation=&quot;http://xmlns.jcp.org/xml/ns/persistence 
  http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd&quot;&gt;
    &lt;persistence-unit name=&quot;InvoicesPU&quot; transaction-type=&quot;JTA&quot;&gt;
      &lt;jta-data-source&gt;java:app/Invoices&lt;/jta-data-source&gt;
      &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
      &lt;properties/&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  <p>And in my java class I call it by:</p>
  <pre><code>@Stateless
  public class InvoiceEJB implements InvoiceEJBLocal {
  
      @PersistenceContext(unitName = &quot;InvoicesPU&quot;)
      EntityManager em;
      ...
      em.someMethod();
  </code></pre>
  <p>For completeness, I have no error during the compilation phase!</p>
  <p>Anyone know how to solve it?</p>