title: cannot access class javax.persistence.Persistence (in unnamed module @0x21e018cc) because module com.mycompany.modpersona does not read unnamed module
body: <p>The error occurs when making the call from the simple module to the modpersona module to access a database table.</p>
  <p>Appreciate if anyone can shed light on why this error is thrown.</p>
  <p>It is a MAVEN project.</p>
  <blockquote>
  <p>OS FEDORA 32 ; NETBEANS 12.1 ; JAVA 15 ; JAVAFX 15  ; NETBEANS 12.1 ;
  MY SQL 8.0.21</p>
  </blockquote>
  <p>Exception in Application start method
  java.lang.reflect.InvocationTargetException
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:564)
  at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
  at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:564)
  at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
  Caused by: java.lang.RuntimeException: Exception in Application start method
  at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
  at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
  at java.base/java.lang.Thread.run(Thread.java:832)</p>
  <p>Caused by: java.lang.IllegalAccessError: class com.mycompany.modpersona.PersonaDAO (in module com.mycompany.modpersona) cannot access class javax.persistence.Persistence (in unnamed module @0x21e018cc) because module com.mycompany.modpersona does not read unnamed module @0x21e018cc
  at com.mycompany.modpersona/com.mycompany.modpersona.PersonaDAO.(PersonaDAO.java:17)
  at com.mycompany.simple/com.mycompany.simple.App.start(App.java:21)
  at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
  at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
  at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
  at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
  at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
  at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
  at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
  at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
  ... 1 more
  Exception running application com.mycompany.simple.App
  package com.mycompany.simple;</p>
  <pre><code>public void start(Stage stage) {
      System.out.println(&quot;hola new york&quot;);
      
      final PersonaDAO daoPersona = new PersonaDAO();
      Persona entPersona = daoPersona.getPersonaByCodigo(&quot;V00000000000&quot;);
      String strNombre = entPersona.getNombrePersona();
      System.out.println(strNombre);
  </code></pre>
  <p>public class PersonaDAO {</p>
  <pre><code>private final PersonaJPA personaController;
  private final EntityManagerFactory emf;
  
  public PersonaDAO() {
      emf = Persistence.createEntityManagerFactory(&quot;com.mycompany_modpersona_jar_1.0-SNAPSHOTPU&quot;);
      personaController = new PersonaJPA(emf);
  }
  
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
  &lt;artifactId&gt;modpersona&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&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.6.1&lt;/version&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.core&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.asm&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.antlr&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.jpa&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.jpa.jpql&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.moxy&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&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.2.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.jpa.modelgen.processor&lt;/artifactId&gt;
          &lt;version&gt;2.7.7&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;15&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;15&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  </code></pre>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
  &lt;artifactId&gt;simple&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;11&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;11&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
          &lt;artifactId&gt;javafx-controls&lt;/artifactId&gt;
          &lt;version&gt;15&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;${project.groupId}&lt;/groupId&gt;
          &lt;artifactId&gt;modpersona&lt;/artifactId&gt;
          &lt;version&gt;${project.version}&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;release&gt;11&lt;/release&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
              &lt;artifactId&gt;javafx-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;0.0.4&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;mainClass&gt;com.mycompany.simple.App&lt;/mainClass&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;!-- Default configuration for running --&gt;
                      &lt;!-- Usage: mvn clean javafx:run --&gt;
                      &lt;id&gt;default-cli&lt;/id&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;!-- Configuration for manual attach debugging --&gt;
                      &lt;!-- Usage: mvn clean javafx:run@debug --&gt;
                      &lt;id&gt;debug&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;options&gt;
                              &lt;option&gt;-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000&lt;/option&gt;
                          &lt;/options&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;!-- Configuration for automatic IDE debugging --&gt;
                      &lt;id&gt;ide-debug&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;options&gt;
                              &lt;option&gt;-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}&lt;/option&gt;
                          &lt;/options&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
                  &lt;execution&gt;
                      &lt;!-- Configuration for automatic IDE profiling --&gt;
                      &lt;id&gt;ide-profile&lt;/id&gt;
                      &lt;configuration&gt;
                          &lt;options&gt;
              &lt;option&gt;${profiler.jvmargs.arg1}&lt;/option&gt;
              &lt;option&gt;${profiler.jvmargs.arg2}&lt;/option&gt;
              &lt;option&gt;${profiler.jvmargs.arg3}&lt;/option&gt;
              &lt;option&gt;${profiler.jvmargs.arg4}&lt;/option&gt;
              &lt;option&gt;${profiler.jvmargs.arg5}&lt;/option&gt;
                          &lt;/options&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>