Both in my rich client and in my EJBs I am using a framework which can optionally be used with JavaFX. This means that when my EJBs are running inside WildFly the JavaFX runtimer jar jfxrt.jar needs to be available.
Since Java 8, jfxrt.jar has moved into the $JAVA_HOME/jre/lib/ext folder, which means the jfxrt.jar classes are loaded automatically if you start a JavaFX based application.
However, when I deploy to WildFly I get typical WildFly StartException caused by:
This tells me, that WildFly does not load JavaFX automatically. I have been reading up on WildFly class loading and modules, and it seems I am supposed to define jfxrt.jar as a WildFly module, so first I have created the folder
and inside that folder I have created a module.xml file containing this XML:
<module xmlns="urn:jboss:module:1.1" name="javafx.api">
With a path for each of the javafx packages.
This, however, had no effect, so I tried adding a dependency on this module, by typing this in my ejb.jar's manifest.mf file:
This also had no effect. Then I tried telling WildFly to always make the javafx.api module available globally by adding this to WildFly's domain.xml file:
<!-- javafx -->
<subsystem xmlns="urn:jboss:domain:ee:1.0" >
<module name="javafx.api" slot="main"/>
This also had no effect.
Now, I know could copy jfxrt.jar directly into my WildFly module, but that's not what I am looking for. Rather, I want WildFly to make available whatever JavaFX classes the JRE comes with – just like the JDK does, when I run an app on the comand line. I would be grateful, if anyone could offer some ideas for how to do that.