MvvmFx and Java 10

138 views
Skip to first unread message

frederik.v...@chapoo.com

unread,
Sep 18, 2018, 9:16:15 AM9/18/18
to MvvmFX
Hey,

I'm developing a javafx application using mvvmFx amongst others, and wanted to have a go at modularising it in order to create a custom runtime with jlink.

After adding the module-info.java with the needed requires and export statements,
I am able to produce a fully working artifact with spring boot by running mvn clean install spring-boot:repackage.

However, when trying to run the application from inside IntelliJ (using either the Run Dashboard or the plain old "Run" button, I get the following exception:

java.io.IOException: Error loading FXML - can't load from given resourcepath: /com/xxx/xxx/xxx/xxx/xxx/xxx.fxml (x's are obviously not there in the actual app ;) )
    at mvv...@1.7.0/de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.createFxmlLoader(FxmlViewLoader.java:239)
    at mvv...@1.7.0/de.saxsys.mvvmfx.internal.viewloader.FxmlViewLoader.loadFxmlViewTuple(FxmlViewLoader.java:169)

The fxml files are in the resources directory as usual, in the correct packages.

Note, everything was working fine before adding the module-info.java so it's obviously related,
but I'm not sure if this is a mvvmFx issue or a IntelliJ issue ;)

Manuel Mauky

unread,
Sep 18, 2018, 9:24:36 AM9/18/18
to MvvmFX
Hi,

as far as I can tell this is a problem within mvvmFX that we already have on our list. There is already a Pull-Request for this (https://github.com/sialcasa/mvvmFX/pull/555)
but it wasn't merged because we have no unit-tests to prove that it works and to be safe for refactorings in the future. The reason is that this kind of issue isn't easy to test with a simple unit-test but instead you would need to create a separate module.

However, Now that you are the second one that is facing this problem, I think I will merge the PR even without tests and add tests later on. After the PR is merged you can then verify if it works by using the snapshot-Version of mvvmFX.
I'd like to hear feedback if this is the same issue and if it's really solved by the PR.

greetings,
Manuel

frederik.v...@chapoo.com

unread,
Sep 18, 2018, 9:41:15 AM9/18/18
to MvvmFX
I'd be happy to test with the snapshot where the PR is merged into and provide feedback.

Manuel Mauky

unread,
Sep 18, 2018, 10:23:58 AM9/18/18
to MvvmFX
I finished the merge. You can now test it with:

<dependency> <groupId>de.saxsys</groupId> <artifactId>mvvmfx</artifactId> <version>1.8.0-SNAPSHOT</version> </dependency>


from the sonatype snapshot repository.

Christian Rocholl

unread,
Nov 26, 2019, 4:18:23 PM11/26/19
to MvvmFX
Hi I am getting exact error same as OP resource file not found, yet it is there, is this still an issue? it might be related to modules-info.java?

I am using mvvmfx 1.8.0 though

regards chris
Reply all
Reply to author
Forward
0 new messages