0

simple モジュールから modpersona モジュールを呼び出してデータベース テーブルにアクセスすると、エラーが発生します。

このエラーがスローされる理由を誰かが明らかにできるかどうかに感謝します。

これは MAVEN プロジェクトです。

OS フェドラ 32 ; ネットビーンズ 12.1; ジャワ 15 ; JAVAFX 15 ; ネットビーンズ 12.1; 私のSQL 8.0.21

java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) でのアプリケーション起動メソッド java.lang.reflect.InvocationTargetException での例外 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) で、java.base/java.lang.reflect.Method.invoke(Method.java:564) で、javafx.graphics/com で。 javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363) の sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464) 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.java.base/java.lang.reflect.Method.invoke(Method.java:564) の DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java: 1071) 原因: java.lang.RuntimeException: javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) のアプリケーション開始メソッドの例外 javafx.graphics/com.sun.javafx. java.base/java.lang.Thread.run(Thread.java:832) の application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) の javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) の java.base /java.lang.Thread.run(Thread.java:832)graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900) の javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) の java.base /java.lang.Thread.run(Thread.java:832)

原因: java.lang.IllegalAccessError: クラス com.mycompany.modpersona.PersonaDAO (モジュール com.mycompany.modpersona 内) は、クラス javax.persistence.Persistence (名前のないモジュール @0x21e018cc 内) にアクセスできません。 com.mycompany.modpersona/com.mycompany.modpersona.PersonaDAO で名前のないモジュール @0x21e018cc を読み取ります。(PersonaDAO.java:17) com.mycompany.simple/com.mycompany.simple.App.start(App.java:21) でjavafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846) で javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java: 455) javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428) で java.base/java.security.AccessController.doPrivileged(AccessController.java:391) で javafx.グラフィックス/ com。sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427) javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) で 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 つ以上の例外実行中のアプリケーション com.mycompany.simple.App パッケージ com.mycompany.simple;simple.App パッケージ com.mycompany.simple;simple.App パッケージ com.mycompany.simple;

public void start(Stage stage) {
    System.out.println("hola new york");
    
    final PersonaDAO daoPersona = new PersonaDAO();
    Persona entPersona = daoPersona.getPersonaByCodigo("V00000000000");
    String strNombre = entPersona.getNombrePersona();
    System.out.println(strNombre);

public class PersonaDAO {

private final PersonaJPA personaController;
private final EntityManagerFactory emf;

public PersonaDAO() {
    emf = Persistence.createEntityManagerFactory("com.mycompany_modpersona_jar_1.0-SNAPSHOTPU");
    personaController = new PersonaJPA(emf);
}


<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>modpersona</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.core</artifactId>
        <version>2.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.asm</artifactId>
        <version>2.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.antlr</artifactId>
        <version>2.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa</artifactId>
        <version>2.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa.jpql</artifactId>
        <version>2.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.moxy</artifactId>
        <version>2.7.7</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>org.eclipse.persistence.jpa.modelgen.processor</artifactId>
        <version>2.7.7</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>15</maven.compiler.source>
    <maven.compiler.target>15</maven.compiler.target>
</properties>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>simple</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>15</version>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>modpersona</artifactId>
        <version>${project.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <release>11</release>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-maven-plugin</artifactId>
            <version>0.0.4</version>
            <configuration>
                <mainClass>com.mycompany.simple.App</mainClass>
            </configuration>
            <executions>
                <execution>
                    <!-- Default configuration for running -->
                    <!-- Usage: mvn clean javafx:run -->
                    <id>default-cli</id>
                </execution>
                <execution>
                    <!-- Configuration for manual attach debugging -->
                    <!-- Usage: mvn clean javafx:run@debug -->
                    <id>debug</id>
                    <configuration>
                        <options>
                            <option>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000</option>
                        </options>
                    </configuration>
                </execution>
                <execution>
                    <!-- Configuration for automatic IDE debugging -->
                    <id>ide-debug</id>
                    <configuration>
                        <options>
                            <option>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</option>
                        </options>
                    </configuration>
                </execution>
                <execution>
                    <!-- Configuration for automatic IDE profiling -->
                    <id>ide-profile</id>
                    <configuration>
                        <options>
            <option>${profiler.jvmargs.arg1}</option>
            <option>${profiler.jvmargs.arg2}</option>
            <option>${profiler.jvmargs.arg3}</option>
            <option>${profiler.jvmargs.arg4}</option>
            <option>${profiler.jvmargs.arg5}</option>
                        </options>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
4

0 に答える 0