I try to add some class of java RMI that works fine in separate project. When i added the classes to my java fx project , i have got this error:
Package 'com.example' reads package 'javafx.beans' from both 'javafx.base' and 'javafx.base'
this is my pom.xml:enter image description here
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>FXtest</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>FXtest</name>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit.version>5.8.1</junit.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>17.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>17.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-web</artifactId>
            <version>17.0.1</version>
        </dependency>
  <dependency>
            <groupId>org.controlsfx</groupId>
            <artifactId>controlsfx</artifactId>
            <version>11.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.dlsc.formsfx</groupId>
            <artifactId>formsfx-core</artifactId>
            <version>11.3.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.openjfx</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.synedra</groupId>
            <artifactId>validatorfx</artifactId>
            <version>0.1.13</version>
            <exclusions>
                <exclusion>
                    <groupId>org.openjfx</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-javafx</artifactId>
            <version>12.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.kordamp.bootstrapfx</groupId>
            <artifactId>bootstrapfx-core</artifactId>
            <version>0.4.0</version>
        </dependency>
        <dependency>
            <groupId>eu.hansolo</groupId>
            <artifactId>tilesfx</artifactId>
            <version>11.48</version>
            <exclusions>
                <exclusion>
                    <groupId>org.openjfx</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>17</source>
                    <target>17</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.8</version>
                <executions>
                    <execution>
                        <!-- Default configuration for running with: mvn clean javafx:run -->
                        <id>default-cli</id>
                        <configuration>
                            <mainClass>com.example.fxtest/com.example.fxtest.HelloApplication</mainClass>
                            <launcher>app</launcher>
                            <jlinkZipName>app</jlinkZipName>
                            <jlinkImageName>app</jlinkImageName>
                            <noManPages>true</noManPages>
                            <stripDebug>true</stripDebug>
                            <noHeaderFiles>true</noHeaderFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
this is the console error i get when i run my rmi-server:
Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make public abstract void com.example.fxtest.shared.CardgameServer.toUpperCase(java.lang.String,com.example.fxtest.shared.CardgameClient) throws java.rmi.RemoteException accessible: module com.example.fxtest does not "exports com.example.fxtest.shared" to module java.rmi
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    at java.rmi/sun.rmi.server.UnicastServerRef$HashToMethod_Maps$1.run(UnicastServerRef.java:598)
    at java.rmi/sun.rmi.server.UnicastServerRef$HashToMethod_Maps$1.run(UnicastServerRef.java:596)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.rmi/sun.rmi.server.UnicastServerRef$HashToMethod_Maps.computeValue(UnicastServerRef.java:595)
    at java.rmi/sun.rmi.server.UnicastServerRef$HashToMethod_Maps.computeValue(UnicastServerRef.java:574)
    at java.rmi/sun.rmi.server.WeakClassHashMap.get(WeakClassHashMap.java:74)
    at java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:236)
    at java.rmi/java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:475)
    at java.rmi/java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:360)
    at com.example.fxtest/com.example.fxtest.server.ServerImpl.<init>(ServerImpl.java:13)
    at com.example.fxtest/com.example.fxtest.server.RunServer.main(RunServer.java:15)
i addad a photo of my module-info.java where the error is found.
any adivce will be appreciated! thanks
 
     
    