Maven build issues

The VASL module, which contains a lot of custom java classes, is structured as a Maven project which uses a pom.xml file to drive the VASL build. The VASSAL team has done a lot of work for us to shape that pom and run it in a way that produces the build that we need. All of this is working extremely well and building and releasing new versions of VASL is quite easy now.

Recently, I have been trying to add javafx to the code tools that we use. I can get this to work in a dev environment. The Maven build process continues to work. However, when I take the jar file and rename it to .vmod and then run it from the VASSAL window, I get a VASSAL bug.

I have added below the current pom file - I needed to add to it in order for the pom to include the javafx classes. I have also added the final lines from the Maven build output which highlights the probem (I think).

I have been reading about various methods to try and fix this and have tried some but to no avail.

Does anyone have any experience or ideas about this?

Thanks.

POM

4.0.0

<groupId>org.vasl</groupId>
<artifactId>vasl</artifactId>
<version>6.6.6-beta5</version>
<packaging>jar</packaging>

<properties>
    <project.build.sourceEncoding>Cp1252</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>org.vassalengine</groupId>
        <artifactId>vassal-app</artifactId>
        <version>3.6.11</version>
    </dependency>

    <!-- We do not have any tests yet, but time will tell... -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.1</version>
        <scope>test</scope>
    </dependency>
    <!-- Add dependencies that are not part of VASSAL here -->
    <dependency>
        <groupId>org.jdom</groupId>
        <artifactId>jdom2</artifactId>
        <version>2.0.5</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-graphics</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-swing</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-base</artifactId>
        <version>19</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>19</version>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>vassal</id>
        <url>https://vassalengine.org/maven</url>
    </repository>
</repositories>

<build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
        <resource>
            <directory>dist</directory>
            <filtering>true</filtering>
            <includes>
                <include>buildFile</include>
                <include>moduledata</include>
            </includes>
        </resource>
        <resource>
            <directory>dist</directory>
            <filtering>false</filtering>
            <excludes>
                <exclude>buildFile</exclude>
                <exclude>moduledata</exclude>
            </excludes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <verbose>true</verbose>
                <source>11</source>
                <target>11</target>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>create</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <doCheck>false</doCheck>
                <doUpdate>false</doUpdate>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <configuration>
                <executable>${jdk}/bin/java</executable>
                <workingDirectory>${basedir}</workingDirectory>
                <arguments>
                    <argument>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</argument>
                    <argument>-jar</argument>
                    <argument>Vengine-3.6.11.jar</argument>
                    <argument>--standalone</argument>
                    <argument>target/${project.build.finalName}.jar</argument>
                </arguments>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <artifactSet>
                            <includes>
                                <!-- Add more jar to include here, but they need to be a
                                    dependency as well. -->
                                <include>org.jdom:jdom2</include>
                                <include>org.openjfx:javafx-controls</include>
                                <include>org.openjfx:javafx-swing</include>
                                <include>org.openjfx:javafx-graphics</include>
                                <include>org.openjfx:javafx-base</include>

                            </includes>
                        </artifactSet>
                        <!--
                        <relocations>
                            <relocation>
                                <pattern>org.openjfx.javafx-controls</pattern>
                                <shadedPattern>org.shaded.javafx-controls</shadedPattern>
                                <excludes>

                                </excludes>
                            </relocation>
                        </relocations> -->
                    </configuration>
                </execution>
            </executions>
        </plugin>


    </plugins>
</build>

<name>VASL</name>
<url>https://github.com/vasl-developers</url>
<licenses>
    <license>
        <name>GNU Lesser General Public License, version 2.1</name>
        <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html</url>
        <distribution>distribution</distribution>
        <comments>The GNU General Public License is intended to guarantee your freedom to share and change free
            software--to make sure the software is free for all its users.
        </comments>
    </license>
</licenses>

<issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/vasl-developers/vasl/issues</url>
</issueManagement>

<scm>
    <url>https://github.com/vasl-developers/vasl</url>
    <connection>scm:git:git://github.com/vasl-developers/vasl.git</connection>
    <developerConnection>scm:git:git@github.com:vasl-developers/vasl.git</developerConnection>
</scm>

Maven build output
Including org.jdom:jdom2:jar:2.0.5 in the shaded jar.
[INFO] Including org.openjfx:javafx-controls:jar:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-controls:jar:win:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-graphics:jar:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-graphics:jar:win:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-swing:jar:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-swing:jar:win:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-base:jar:19 in the shaded jar.
[INFO] Including org.openjfx:javafx-base:jar:win:19 in the shaded jar.
[INFO] Excluding org.openjfx:javafx-fxml:jar:19 from the shaded jar.
[INFO] Excluding org.openjfx:javafx-fxml:jar:win:19 from the shaded jar.
[WARNING] javafx-base-19-win.jar, javafx-graphics-19-win.jar, javafx-swing-19-win.jar, javafx-controls-19-win.jar define 1 overlappping classes:
[WARNING] - module-info
[WARNING] maven-shade-plugin has detected that some .class files
[WARNING] are present in two or more JARs. When this happens, only
[WARNING] one single version of the class is copied in the uberjar.
[WARNING] Usually this is not harmful and you can skeep these
[WARNING] warnings, otherwise try to manually exclude artifacts
[WARNING] based on mvn dependency:tree -Ddetail=true and the above
[WARNING] output
[WARNING] See http://docs.codehaus.org/display/MAVENUSER/Shade+Plugin
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing c:\Users\dougr_000\IdeaProjects\GameUpdater\target\vasl-6.6.6-beta5.jar with c:\Users\dougr_000\IdeaProjects\GameUpdater\target\vasl-6.6.6-beta5-shaded.jar
[INFO] Dependency-reduced POM written at: c:\Users\dougr_000\IdeaProjects\GameUpdater\dependency-reduced-pom.xml
[INFO] Dependency-reduced POM written at: c:\Users\dougr_000\IdeaProjects\GameUpdater\dependency-reduced-pom.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:28 min
[INFO] Finished at: 2023-02-09T10:19:59-05:00
[INFO] ------------------------------------------------------------------------

I should have included the VASSAL error log referenced above. Here it is:

2023-02-09 10:31:27,791 [101884-main] INFO VASSAL.launch.StartUp - Starting
2023-02-09 10:31:27,809 [101884-main] INFO VASSAL.launch.StartUp - OS Windows 10 10.0 amd64
2023-02-09 10:31:27,809 [101884-main] INFO VASSAL.launch.StartUp - Java version 19.0.2
2023-02-09 10:31:27,810 [101884-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.11\jre
2023-02-09 10:31:27,810 [101884-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.11
2023-02-09 10:31:28,011 [101884-AWT-EventQueue-0] INFO VASSAL.launch.ModuleManager - Manager
2023-02-09 10:31:28,787 [101884-AWT-EventQueue-0] INFO VASSAL.launch.ModuleManagerWindow - Module C:\Users\dougr_000\IdeaProjects\GameUpdater\target\original-vasl-6.6.6-beta5.vmod not found - Removed.
2023-02-09 10:31:50,197 [101884-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module file C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\vasl-6.6.6-updater-beta5.vmod
2023-02-09 10:31:52,769 [101884-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.TilingHandler - No images to tile.
2023-02-09 10:31:52,773 [101884-SwingWorker-pool-2-thread-1] INFO VASSAL.launch.AbstractLaunchAction - Loading module VASL
2023-02-09 10:31:52,786 [101884-SwingWorker-pool-2-thread-1] INFO VASSAL.tools.io.ProcessLauncher - launching C:\Program Files\VASSAL-3.6.11\jre\bin\java -Xms512M -Xmx512M -Duser.home=C:\Users\dougr_000 -Duser.dir=C:\Program Files\VASSAL-3.6.11 -cp lib\Vengine.jar VASSAL.launch.Player --load – C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\vasl-6.6.6-updater-beta5.vmod
2023-02-09 10:31:53,982 [80516-main] INFO VASSAL.launch.StartUp - Starting
2023-02-09 10:31:54,000 [80516-main] INFO VASSAL.launch.StartUp - OS Windows 10 10.0 amd64
2023-02-09 10:31:54,000 [80516-main] INFO VASSAL.launch.StartUp - Java version 19.0.2
2023-02-09 10:31:54,000 [80516-main] INFO VASSAL.launch.StartUp - Java home C:\Program Files\VASSAL-3.6.11\jre
2023-02-09 10:31:54,000 [80516-main] INFO VASSAL.launch.StartUp - VASSAL version 3.6.11
2023-02-09 10:31:54,001 [80516-main] INFO VASSAL.launch.Launcher - Player
2023-02-09 10:32:00,468 [80516-AWT-EventQueue-0] INFO VASSAL.build.GameModule - VASL version 6.6.6-beta5
2023-02-09 10:32:00,733 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\Aircraft52.mdx
2023-02-09 10:32:00,779 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension Aircraft52 v5.0 loaded
2023-02-09 10:32:00,779 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\BFPv5.01.1.vmdx
2023-02-09 10:32:01,032 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension BFPv5.01.1 v5.01 loaded
2023-02-09 10:32:01,032 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\BoardScaler.vmdx
2023-02-09 10:32:01,040 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension BoardScaler v0.0 loaded
2023-02-09 10:32:01,041 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\hideable-control-markers-1.9.vmdx
2023-02-09 10:32:01,063 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension hideable-control-markers-1.9 v1.9 loaded
2023-02-09 10:32:01,063 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\Hollow Legions.vmdx
2023-02-09 10:32:01,099 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension Hollow Legions v0.0 loaded
2023-02-09 10:32:01,100 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\Nationality Smoke v1.0.vmdx
2023-02-09 10:32:01,107 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension Nationality Smoke v1.0 v0.0 loaded
2023-02-09 10:32:01,107 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\neals-vasl-charts-v1-7.vmdx
2023-02-09 10:32:01,111 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension neals-vasl-charts-v1-7 v1.62 loaded
2023-02-09 10:32:01,111 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\oba-flowchart.vmdx
2023-02-09 10:32:01,117 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension oba-flowchart v1.1 loaded
2023-02-09 10:32:01,117 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\PTOTerrain.vmdx
2023-02-09 10:32:01,121 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension PTOTerrain v0.0 loaded
2023-02-09 10:32:01,121 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\RSCh.vmdx
2023-02-09 10:32:01,131 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension RSCh v1.0 loaded
2023-02-09 10:32:01,131 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\secret-dr-1.0.vmdx
2023-02-09 10:32:01,135 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension secret-dr-1.0 v1.0 loaded
2023-02-09 10:32:01,136 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\terrain-chart-1.2.1.vmdx
2023-02-09 10:32:01,139 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension terrain-chart-1.2.1 v1.2.1 loaded
2023-02-09 10:32:01,139 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Loading extension C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\ext\VASLOverlays_v2.11.vmdx
2023-02-09 10:32:01,285 [80516-AWT-EventQueue-0] INFO VASSAL.build.module.ExtensionsLoader - Extension VASLOverlays_v2.11 v2.11 loaded
2023-02-09 10:32:01,753 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - Feb 09, 2023 10:32:01 AM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from ‘unnamed module @3e5a0bb3

2023-02-09 10:32:01,975 [80516-QuantumRenderer-0] WARN VASSAL.tools.logging.LoggedOutputStream - Graphics Device initialization failed for : d3d, sw

2023-02-09 10:32:01,976 [80516-QuantumRenderer-0] WARN VASSAL.tools.logging.LoggedOutputStream - Error initializing QuantumRenderer: no suitable pipeline found

2023-02-09 10:32:01,976 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found

2023-02-09 10:32:01,976 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)

2023-02-09 10:32:01,976 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)

2023-02-09 10:32:01,976 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:268)

2023-02-09 10:32:01,976 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)

2023-02-09 10:32:01,976 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)

2023-02-09 10:32:01,977 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:225)

2023-02-09 10:32:01,977 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at java.base/java.lang.Thread.run(Thread.java:1589)

2023-02-09 10:32:01,977 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found

2023-02-09 10:32:01,977 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)

2023-02-09 10:32:01,977 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)

2023-02-09 10:32:01,977 [80516-Thread-0] WARN VASSAL.tools.logging.LoggedOutputStream - … 1 more

2023-02-09 10:32:01,980 [80516-AWT-EventQueue-0] ERROR VASSAL.tools.ErrorDialog -
java.lang.RuntimeException: No toolkit found
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:225)
at java.base/java.lang.Thread.run(Thread.java:1589)

You really should be using UTF-8 here. Having source code in anything other than UTF-8 is inviting trouble.

My guess for the JavaFX problem you’re seeing is that you’re trying to run with a JVM that doesn’t have any of the JavaFX modules included. (The one Vassal ships won’t, because nothing in Vassal uses it.)

Is there a branch to look at? I’d like to see what this does on my system with a full JDK.

You really should be using UTF-8 here. Having source code in anything other than UTF-8 is inviting trouble.

I have made this change, thanks.

My guess for the JavaFX problem you’re seeing is that you’re trying to run with a JVM that doesn’t have any of the JavaFX modules included. (The one Vassal ships won’t, because nothing in Vassal uses it.)

Is there a branch to look at? I’d like to see what this does on my system with a full JDK.Blockquote

Yes, on github VASL repo branch: feature\GameConverter. I just pushed some changes to the POM and a couple of other files.

As I said, I can get this to work in my dev environment. There is information on the internet about how to add javafx to an existing java project. It was not easy but I eventually got it to work (although javafx-fxml won’t work at all).

What I can’t seem to do is to replicate that within the Maven build process. Even if Maven includes javafx-controls, javafx-swing, javafx-base and java-graphics (which the build output says are included), they all seem to contain a class of the same name and Maven will only pick one of these. I found some information about adding and relocations but nothing I tried seemed to work.

If I only include one of the java-fx components the “duplicate classes” warning goes away, the build works but it crashes at run time due to missing the other javafx components.

If I build VASL locally, I get this error when I try loading the module:

VASSAL.build.IllegalBuildException: failed to load class VASL.build.module.ScenInfo
	at VASSAL.build.Builder.create(Builder.java:145)
	at VASSAL.build.Builder.build(Builder.java:80)
	at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:104)
	at VASSAL.build.GameModule.build(GameModule.java:706)
	at VASSAL.build.GameModule.build(GameModule.java:637)
	at VASSAL.build.GameModule.init(GameModule.java:1906)
	at VASSAL.launch.Player.launch(Player.java:87)
	at VASSAL.launch.Launcher$1.run(Launcher.java:98)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.NoClassDefFoundError: javafx/scene/Parent
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3429)
	at java.base/java.lang.Class.getConstructor0(Class.java:3634)
	at java.base/java.lang.Class.getConstructor(Class.java:2324)
	at VASSAL.build.Builder.create(Builder.java:118)
	... 20 common frames omitted
Caused by: java.lang.ClassNotFoundException: Unable to load class javafx.scene.Parent
	at VASSAL.tools.DataArchive.findClass(DataArchive.java:454)
	at VASSAL.tools.DataArchive.loadClass(DataArchive.java:427)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 25 common frames omitted
Caused by: java.io.FileNotFoundException: 'javafx/scene/Parent.class' not found in /home/uckelman/projects/VASSAL/modules-src/vasl/vasl/target/vasl-6.6.6-beta5.jar
	at VASSAL.tools.DataArchive.getInputStream(DataArchive.java:179)
	at VASSAL.tools.DataArchive.findClass(DataArchive.java:450)
	... 27 common frames omitted

I would think this is likely because my local version contains references to the javafx components in Project Structure-> Project Settings-> Modules-> Dependencies.

I don’t think these references were included in any of the changes I pushed to feature\GameConverter on github.

I see that my local file vasl.iml contains these references (I think) and I have now pushed it to github. Not sure if this will be sufficient.

Traditionally we have not pushed all of the Maven files and project files that appear in the IDE to github.

Thanks for your help on this.

The .iml file you added belongs to IntelliJ IDEA; it’s not used by maven. I rebuilt with that commit and got the same error when I tried loading the module.

The .iml file you added belongs to IntelliJ IDEA; it’s not used by maven.

Understood. I am not sure how it is generated by IDEA but (1) it appears to match the list of dependencies shown in Project Structure-> Project Settings-> Modules-> Dependencies in IDEA; and (2) virtually every line is a reference to a Maven library.

My thought is that your local list of dependencies probably does not match mine which is why you are getting the error message that your are. Obviously, you know a whole lot more about this stuff than me but that explanation for your error message would seem logical to me. Does this make sense?

I have tried so many different things that I can’t recall how exactly the javafx components got added to the IDEA dependencies list. I believe that I probably clicked the add (+) button on the dependencies tab, went to the .m2 directory in my username folder, and navigated to repository/org/openjfx and then added all of the javafx directories.

Would that be possible within your IDEA?

I appreciate your help on this but don’t want to drag you down a rabbit hole. My particular issue is that while Maven builds the vasl jar and reports success, the file will not run from the VASSAL window.

I don’t use IDEA. I’m not sure what else to suggest.

I don’t use IDEA. I’m not sure what else to suggest.

Understood. So let’s set IDEA aside.

In the Pom.xml file in the project, you should see the following lines under the maven-shade-plugin in the section:

<artifactSet>
     <includes>
          <!-- Add more jar to include here, but they need to be a
                                        dependency as well. -->
          <include>org.jdom:jdom2</include>
          <include>org.openjfx:javafx-controls</include>
          <include>org.openjfx:javafx-swing</include>
          <!-- <include>org.openjfx:javafx-graphics</include>
          <include>org.openjfx:javafx-base</include> -->

     </includes>
</artifactSet>

Could un-comment the javafx-graphics and javafx-base lines and then try the build again and see what happens?

Thanks

Doug

After uncommenting those lines and rebuilding the module, I get this when I try loading it:

2023-02-11 23:15:11,785 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - Feb 11, 2023 11:15:11 PM com.sun.javafx.application.PlatformImpl startup
WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @4bb63c71'
2023-02-11 23:15:11,821 [69130-QuantumRenderer-0] WARN  VASSAL.tools.logging.LoggedOutputStream - Graphics Device initialization failed for :  es2, sw
2023-02-11 23:15:11,821 [69130-QuantumRenderer-0] WARN  VASSAL.tools.logging.LoggedOutputStream - Error initializing QuantumRenderer: no suitable pipeline found
2023-02-11 23:15:11,821 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:283)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:253)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:268)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:225)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at java.base/java.lang.Thread.run(Thread.java:1589)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:95)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
2023-02-11 23:15:11,822 [69130-Thread-0] WARN  VASSAL.tools.logging.LoggedOutputStream - 	... 1 more
2023-02-11 23:15:11,976 [69130-AWT-EventQueue-0] ERROR VASSAL.tools.ErrorDialog - 
java.lang.RuntimeException: No toolkit found
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:280)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:291)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
	at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:225)
	at java.base/java.lang.Thread.run(Thread.java:1589)

That is the same error that I get.

From my “research” on the internet, it seems to be due to how maven creates the shade file. Each of the four javafx components (javafx-controls, javafx-swing, javafx-graphics and javafx-base) seem to include a class of the same name and the shaded jar only includes one of the four.

Are you aware of any way to rectify this, by either changing how the maven-shade-plugin builds the jar or by not using the plugin?

What does the maven-shade-plugin do? It’s not one I’m familiar with.

From the Apache Maven website:

[The Shade Plugin] provides the capability to package the artifact in an uber-jar, including its dependencies and to shade - i.e. rename - the packages of some of the dependencies.

[It] repackages the project classes together with their dependencies into a single uber-jar, optionally renaming classes or removing unused classes.

The “include” items in the POM under this plugin are designed to retain javafx classes that shade would otherwise remove. However, when it encounters multiple classes of the same name, even if indifferent javafx components, it apparently will only retain one of them. There is a renaming functionality that might be useful in this regard but I have not be able to get it to work.

Unless this triggers any ideas on your part, I suggest we leave it here. I am going to have to find a way to live without the javafx classes. Which should be doable. I was going to try and fix a particular issue with them but more importantly I wanted to explore their capabilities to see what they might enable us to do in VASL.

I think a better approach would be to do that experimentation outside of VASL to first determine if javafx is worth the effort it will take to get it to work inside of VASL.

As always, thanks for being so reponsive.

Why are there multiple classes with the same name among the javafx packages? That makes me thing something is wrong at the very start. That’s an odd way to package things.

I thought it might be because, due to all my machinations and farting around, I had multiple copies of openjdk.javafx components. So I stripped out everything that looked like a duplicate copy. No joy. I still get the same warning during the Maven build.

There is always the possibility that the warning about duplicate classes that I get during the Maven build is not what is causing the error when I try to run the .jar file (renamed .vmod) from VASSAL. The key part of that error message is as follows:

Caused by: java.io.FileNotFoundException: ‘javafx/scene/Parent.class’ not found in C:\Users\dougr_000\Documents\Programming Documents\VASLBuilds\vasl-6.6.6-updater-beta5.vmod
at VASSAL.tools.DataArchive.getInputStream(DataArchive.java:179)
at VASSAL.tools.DataArchive.findClass(DataArchive.java:450)

I have been thinking that this “class not found” is due to the Maven warning. But it could be a completely separate problem.

There is no javafx/scene/Parent.class in the module when I build it using ./mvnw package at 9eb36095. I do have that file if I uncomment

<include>org.openjfx:javafx-graphics</include>
<include>org.openjfx:javafx-base</include>

in the pom.xml and rebuild.

Yes, my error. I was trying various things to see if I could detect what the duplicate classes might be. Forgot to uncomment.

What happens if you load the .vmod produced by the build?

When I load the .vmod produced by including those lines, I get the error in this message above: Maven build issues - #11 by uckelman

I really appreciate your help on this. It is time for me to go back to square one and start all over again.

At one point, I was in this situation:

My dev environment is looking for a Toolkit class in java.awt and finds it. My .vmod built with Maven is looking for a Toolkit class in com.sun.javafx.tk and not finding it. I can’t find out why it is looking in the wrong place.

I need to start by building a simple javafx app that runs and learn from that how to add javafx to vasl.