0

I have been trying to build an executable for a javaFX App with the gradle gluonfx plugin but I run into the following issue while running the gradle task 'nativeBuild' : Error: Classes that should be initialized at run time got initialized during image building:

Then I get a lot of classes from ormlite that are "unintentionally initialized at build time" :

[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB]  com.j256.ormlite.field.types.LongType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.LongType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.LongType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DateStringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DateStringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DateStringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BooleanIntegerType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BooleanIntegerType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BooleanIntegerType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.TimeStampType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.TimeStampType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.TimeStampType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BigDecimalStringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BigDecimalStringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BigDecimalStringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BaseDateType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BaseDateType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BaseDateType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.ByteType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.ByteType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.ByteType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.EnumStringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.EnumStringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.EnumStringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.CharacterObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.CharacterObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.CharacterObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.EnumToStringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.EnumToStringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.EnumToStringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.ByteArrayType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.ByteArrayType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.ByteArrayType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.NativeUuidType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.NativeUuidType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.NativeUuidType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.UuidType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.UuidType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.UuidType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BigIntegerType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BigIntegerType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BigIntegerType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.FloatObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.FloatObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.FloatObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.TimeStampStringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.TimeStampStringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.TimeStampStringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.ShortType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.ShortType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.ShortType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.LongStringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.LongStringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.LongStringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.IntegerObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.IntegerObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.IntegerObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.StringBytesType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.StringBytesType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.StringBytesType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DateLongType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DateLongType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DateLongType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DoubleType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DoubleType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DoubleType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.StringType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.StringType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.StringType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.IntType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.IntType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.IntType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DateTimeType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DateTimeType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DateTimeType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BooleanObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BooleanObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BooleanObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DateType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DateType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DateType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BooleanCharType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BooleanCharType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BooleanCharType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DoubleObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DoubleObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DoubleObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.SqlDateType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.SqlDateType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.SqlDateType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.DateIntegerType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.DateIntegerType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.DateIntegerType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.CharType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.CharType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.CharType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.ByteObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.ByteObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.ByteObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.LongObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.LongObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.LongObjectType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.EnumIntegerType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.EnumIntegerType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.EnumIntegerType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.SerializableType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.SerializableType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.SerializableType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BigDecimalNumericType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BigDecimalNumericType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BigDecimalNumericType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.FloatType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.FloatType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.FloatType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.BooleanType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.BooleanType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.BooleanType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.CurrencyType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.CurrencyType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.CurrencyType
[lun. juil. 12 11:16:09 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.ShortObjectType was unintentionally initialized at build time. To see why com.j256.ormlite.field.types.ShortObjectType got initialized use --trace-class-initialization=com.j256.ormlite.field.types.ShortObjectType

I am using :

  • the graalVM version recommended by Gluon : graalvm-svm-windows-gluon-21.2.0-dev
  • Gradle 7.0
  • Modular project architecture
  • plugin : id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.2' with the following config :
gluonfx {
    target = "$target"
    graalvmHome = "...\\jdk_sdk_libs\\graalvm-svm-windows-gluon-21.2.0-dev"
    verbose = true
}
  • plugin : id 'org.openjfx.javafxplugin' version '0.0.8'
  • dependency for ormlite core : implementation 'com.j256.ormlite:ormlite-core:5.6'
  • dependency for ormlite jdbc : implementation 'com.j256.ormlite:ormlite-jdbc:5.6'

I also tried to use

gluonfx {
    // ...
    compilerArgs = ['--initialize-at-run-time=com.j256.ormlite.field.types.NativeUuidType']
}

but I get the error :

Error: The class com.j256.ormlite.field.types.NativeUuidType has already been initialized (from the command line with 'com.j256.ormlite.field.types.NativeUuidType'); it is too late to register com.j256.ormlite.field.types.NativeUuidType for build-time initialization
  • Did you try what the error message suggests (`use --trace-class-initialization=com.j256.ormlite.field.types.LongType`)? – José Pereda Jul 12 '21 at 10:45
  • I just did and I get this : ```[lun. juil. 12 13:55:31 CEST 2021][INFO] [SUB] com.j256.ormlite.field.types.LongType was unintentionally initialized at build time. com.j256.ormlite.field.types.LongType has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try marking this class for build-time initialization with --initialize-at-build-time=com.j256.ormlite.field.types.LongType``` Then I tried with --initialize-at-build-time and it changed nothing from what's above. I put the options in the compilerArgs field in build.gradle. – Damien Begon Jul 12 '21 at 12:07

0 Answers0