Cannot find RElative resize on a previewous working project

I am getting thwe following error now that i am centrally loading my JavaFX Scenes by a custom class.
Caused by: java.lang.NoSuchMethodError: 'void com.sun.javafx.scene.NodeHelper.recalculateRelativeSizeProperties(javafx.scene.Node, javafx.scene.text.Font)'
at javafx.controls/javafx.scene.control.Labeled$6.set(Labeled.java:375)
at javafx.controls/javafx.scene.control.Labeled$6.set(Labeled.java:347)
at javafx.graphics/javafx.css.StyleableObjectProperty.applyStyle(StyleableObjectProperty.java:68)
at javafx.controls/javafx.scene.control.Labeled$6.applyStyle(Labeled.java:361)
at javafx.controls/javafx.scene.control.Labeled$6.applyStyle(Labeled.java:347)
at javafx.graphics/javafx.scene.CssStyleHelper.transitionToState(CssStyleHelper.java:787)
at javafx.graphics/javafx.scene.Node.doProcessCSS(Node.java:9647)
...
Caused by: java.lang.NoSuchMethodError: 'void com.sun.javafx.scene.NodeHelper.recalculateRelativeSizeProperties(javafx.scene.Node, javafx.scene.text.Font)'
at javafx.controls/javafx.scene.control.Labeled$6.set(Labeled.java:375)
at javafx.controls/javafx.scene.control.Labeled$6.set(Labeled.java:347)
at javafx.graphics/javafx.css.StyleableObjectProperty.applyStyle(StyleableObjectProperty.java:68)
at javafx.controls/javafx.scene.control.Labeled$6.applyStyle(Labeled.java:361)
at javafx.controls/javafx.scene.control.Labeled$6.applyStyle(Labeled.java:347)
at javafx.graphics/javafx.scene.CssStyleHelper.transitionToState(CssStyleHelper.java:787)
at javafx.graphics/javafx.scene.Node.doProcessCSS(Node.java:9647)
...
And i know that the code was working before i implemented a centralized scene manager. The manager works pretty well and still works on scenes that dont try to call this method....
23 Replies
JavaBot
JavaBot10mo ago
This post has been reserved for your question.
Hey @NeoCortex97! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st10mo ago
Are you using a build tool? If so, can you show your build config? and how are you running the application?
JavaBot
JavaBot10mo ago
Please make sure you provide sufficient information for others to be able to understand and reproduce your issue. If possible, it is helpful to provide a minimal, complete and verifiable example (i.e. including the minimal code/configuration to run into your issue) showing the problem. Remember that people can help you only if they know what you are struggling with.
NeoCortex97
NeoCortex97OP10mo ago
parent pom.xml:
<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.solupharm</groupId>
<artifactId>HRGT-next</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>HRGT-next</name>
<modules>
<module>SoluHrm</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.9.1</junit.version>
<lombok.version>edge-SNAPSHOT</lombok.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.1.2</version>
</dependency>
<dependency>
<groupId>com.dlsc.gemsfx</groupId>
<artifactId>gemsfx</artifactId>
<version>1.72.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
<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.solupharm</groupId>
<artifactId>HRGT-next</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>HRGT-next</name>
<modules>
<module>SoluHrm</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.9.1</junit.version>
<lombok.version>edge-SNAPSHOT</lombok.version>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>17.0.2</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
<artifactId>controlsfx</artifactId>
<version>11.1.2</version>
</dependency>
<dependency>
<groupId>com.dlsc.gemsfx</groupId>
<artifactId>gemsfx</artifactId>
<version>1.72.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
NeoCortex97
NeoCortex97OP10mo ago
child pom.xml:
NeoCortex97
NeoCortex97OP10mo ago
Here is a failing fxml:
NeoCortex97
NeoCortex97OP10mo ago
This is the Load method of my sceneManager:
public void load(String name, String resourcePath, String title) {
log.debug("Loading {} @ {}", name, resourcePath);
String extendedResourcePath = (resourcePath.endsWith(".fxml") ? resourcePath : resourcePath + ".fxml");
log.debug(extendedResourcePath);
if(base != null) {
File resourceFile = new File(base.getResource("").getFile(), extendedResourcePath);
log.debug(resourceFile.toString());
}
FXMLLoader loader = new FXMLLoader(findResource(resourcePath));
try {
Parent parent = loader.load();
SceneController controller = loader.getController();
if (controller == null)
throw new IllegalStateException("No controller present.");
log.debug("Loaded {}", name);
register(name, new Scene(parent), controller, title);
} catch (IOException e) {
log.debug("Loading {} @ {} failed", name, resourcePath);
throw new RuntimeException(e);
}
}
public void load(String name, String resourcePath, String title) {
log.debug("Loading {} @ {}", name, resourcePath);
String extendedResourcePath = (resourcePath.endsWith(".fxml") ? resourcePath : resourcePath + ".fxml");
log.debug(extendedResourcePath);
if(base != null) {
File resourceFile = new File(base.getResource("").getFile(), extendedResourcePath);
log.debug(resourceFile.toString());
}
FXMLLoader loader = new FXMLLoader(findResource(resourcePath));
try {
Parent parent = loader.load();
SceneController controller = loader.getController();
if (controller == null)
throw new IllegalStateException("No controller present.");
log.debug("Loaded {}", name);
register(name, new Scene(parent), controller, title);
} catch (IOException e) {
log.debug("Loading {} @ {} failed", name, resourcePath);
throw new RuntimeException(e);
}
}
dan1st
dan1st10mo ago
How are you running the program? Does it work without the JAR?
NeoCortex97
NeoCortex97OP10mo ago
Without what jar?
dan1st
dan1st10mo ago
How do you run the project?
NeoCortex97
NeoCortex97OP10mo ago
as a jar and with intellij as a class. There is no difference depending on packaging.
dan1st
dan1st10mo ago
Does it work without using gemsfx? and is there more to the stack trace?
NeoCortex97
NeoCortex97OP10mo ago
It does not. A gemsfx screen works fine, after i fremoved a Font tag. Tehre are hundreds of lines of deep javafx crap that does not say anything remotely useful.
dan1st
dan1st10mo ago
Can you show the other lines? what exactly do you need to change for it to work? Note that idk about gemsfx I feel like it could be version conflicts maybe try using JavaFX 19.0.2.1 since that's what GemsFX 1.72.0 seems to be using
dan1st
dan1st10mo ago
GitHub
GemsFX/pom.xml at c927198c37a0b0df82744f8d8d68bdaf39414f52 · dlsc-s...
A collection of JavaFX controls and utilities. Contribute to dlsc-software-consulting-gmbh/GemsFX development by creating an account on GitHub.
JavaBot
JavaBot10mo ago
<javafx.version>19.0.2.1</javafx.version>
<javafx.version>19.0.2.1</javafx.version>
NeoCortex97
NeoCortex97OP10mo ago
I mainly had to comment out Font Tags on objects with changed font size. I'll try javafx 19 tho. but it worked like this before moving the scene manager to its own package.
dan1st
dan1st10mo ago
which font tags? I can't find them
JavaBot
JavaBot10mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
NeoCortex97
NeoCortex97OP10mo ago
Here is a sample:
<Label alignment="CENTER" text="Betriebsarzt Besuche">
<font> <!-- intellij thinks this is kinda redundant and could refactored away -->
<Font size="48.0"/> <!-- This Tag is teh problem -->
</font>
</Label>
<Label alignment="CENTER" text="Betriebsarzt Besuche">
<font> <!-- intellij thinks this is kinda redundant and could refactored away -->
<Font size="48.0"/> <!-- This Tag is teh problem -->
</font>
</Label>
dan1st
dan1st10mo ago
you could maybe try setting the font via CSS
NeoCortex97
NeoCortex97OP10mo ago
This doesn't work either.
JavaBot
JavaBot10mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server