Open Burtan opened 4 years ago
what version of TornadoFX? For Java 9+ you need to use 2.0.0-SNAPSHOT
Sorry for not mentioning, I'm already using 2.0.0-SNAPSHOT.
does your application use modules? I remember I had problems with modules and kotlin in gradle
The application itself is modular, yes (with module-info.class). I'm using gradle 6.6.1 with this extension: https://github.com/jjohannes/extra-java-module-info. It builds fine. I'm pretty sure that TornadoFX is not using a valid method, thus the exception described in the first post.
give a full stacktrace. also specify the runtime versions
In the class Component.kt of TornadoFX the error is thrown and caught here:
private val _messages: SimpleObjectProperty<ResourceBundle> = object : SimpleObjectProperty<ResourceBundle>() {
override fun get(): ResourceBundle? {
if (super.get() == null) {
try {
val bundle = ResourceBundle.getBundle(FX.messagesNameProvider(this@Component.javaClass), FX.locale, this@Component.javaClass.classLoader, FXResourceBundleControl)
(bundle as? FXPropertyResourceBundle)?.inheritFromGlobal()
set(bundle)
} catch (ex: Exception) {
FX.log.fine("No Messages found for ${javaClass.name} in locale ${FX.locale}, using global bundle")
set(FX.messages)
}
}
return super.get()
}
}
The stacktrace is null.
detailMessage = "ResourceBundle.Control not supported in named modules"
walkback = {long[39]@2389}
cause = {UnsupportedOperationException@2364} "java.lang.UnsupportedOperationException: ResourceBundle.Control not supported in named modules"
stackTrace = null
suppressedExceptions = {Collections$EmptyList@2390} size = 0
disableWritableStackTrace = false
Do you want a minimal example on Github? I can upload one. I'm using AdoptOpenJDK 11.0.8. Tried on linux and windows.
ResourceBundle.Control in Messages.kt has to be replaced when using modules.
One more thing about resources that will be important. Using the old javaClass.getResource* can only load resources from the calling module. They way TornadoFx works, the calling module is almost never the module that contains the resources. E.g.
root = toolbar {
//the calling module is derived from "this@Toolbar" which is javafx.*
imageview("/images/filenew.png")
}
The only way now resources like the image url work is to open the package that contains the resource in module-info.java. In this case this would be opens images;
as described here. I think this pitfall should be documented in TornadoFx.
Any update on this? Pull request wanted?
What is the right branch to make a pull request from?
Is tornadof2 available via maven anywhere? I guess the tornadofx:2.0.0-SNAPSHOT is still based on the tornadofx1 repo?
just moved the jdk 10
branch to the new repository
Did I miss something? The repos seem to be still the same and snapshots wasn't updated?
Alas, yes. I don't see any activity there. The project is inactive, abandoned. I don't know yet whether to do something or not.
Yeah, as I've mentioned I have no time to work on this, but others are of course welcome to contribute if time permits. I'll merge any reasonable PR's obviously. What we need is someone who has time and are willing to drive the project forward.
@edvin here the question is rather about the second version, it is not clear what happened to it and in what condition it is
Hey, when using the messages bundle in an modular app, it won't load with the following error: