首页 > 解决方案 > maven-client-plugin、GraalVM 和类初始化

问题描述

我正在尝试使用 GluonHQ client-maven-plugin生成 JavaFX+FXML 应用程序的本机映像。创建本机映像工作正常,但在尝试执行它时,似乎我的配置错误。

FXML

<?import java.lang.*?>

<?import org.prelle.javafx.NavigationView?>
<?import org.prelle.javafx.NavigationItem?>
<?import org.prelle.javafx.NavigationItemHeader?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.layout.FlowPane?>

<NavigationView xmlns:fx="http://javafx.com/fxml"
    stylesheets="@styles.css"
    displayMode="AUTO">
</NavigationView>

执行失败 org.apache.logging.log4j.message.ParameterizedMessageFactory ClassNotFoundException: org.prelle.javafx.NavigationView

现在我尝试添加我的reflectionconfig.json

[
  {
    "name" : "org.prelle.javafx.NavigationView",
    "allDeclaredConstructors" : true,
    "allPublicConstructors" : true
  }
]

现在的问题是它不再编译了。相反,对于在构建时无意初始化的类,我得到 3 个错误- 例如javafx.scene.control.SkinBase或我的类org.prelle.javafx.skin.NavigationViewSkin的皮肤

我的 NavigationView 构造函数将皮肤显式设置为 NavigationViewSkin,因此调用空构造函数也会调用皮肤构造函数。

我做错了什么?我怎样才能避免这些错误?

编辑:我没有注意到我复制了一条较旧的错误消息(由于 Log4J2 出现问题)。改变了它。

标签: gluongraalvmsubstratevm

解决方案


推荐阅读