quarkus
quarkus copied to clipboard
GraalVM 22.3: Warnings produced in hibernate due to AutomaticFeature deprecation
Describe the bug
When building jpa-postgresql
integration-test (for example) by -Dnative
and GraalVM 22.3-dev the following warning in hibernate code is being produced:
Warning: Feature class org.hibernate.graalvm.internal.QueryParsingSupport is annotated with the deprecated annotation @AutomaticFeature. Support for this annotation will be removed in a future version of GraalVM. Applications should register a feature using the option --features=org.hibernate.graalvm.internal.QueryParsingSupport
Warning: Feature class org.hibernate.graalvm.internal.GraalVMStaticAutofeature is annotated with the deprecated annotation @AutomaticFeature. Support for this annotation will be removed in a future version of GraalVM. Applications should register a feature using the option --features=org.hibernate.graalvm.internal.GraalVMStaticAutofeature
Expected behavior
No warnings from hibernate when producing native images.
Actual behavior
Warnings when generating the native image.
How to Reproduce?
Reproducer
- Get GraalVM 22.3 dev build
- Set as GAALVM_HOME
- Run Quarkus integration-tests
jpa-postgresql
in native mode
Produces output like this:
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /home/sgehwolf/Documents/openjdk/quarkus/quarkus-source/integration-tests/jpa-postgresql/target/quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-native-image-source-jar/quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /home/sgehwolf/Documents/openjdk/quarkus/quarkus-source/integration-tests/jpa-postgresql/target/quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-native-image-source-jar/quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on native-image 22.3.0-dev Mandrel Distribution (Java Version 17.0.4.1-internal+0-adhoc.sgehwolf.jdk17u)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /disk/graal/upstream-sources/graalvm/mandrel-build/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dlogging.initial-configurator.min-level=500 -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.ResourcesFeature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature,io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature,io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:PrintAnalysisCallTreeType=CSV -H:+CollectImageBuildStatistics -H:ImageBuildStatisticsFile=quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner-timing-stats.json -H:BuildOutputJSONFile=quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner-build-output-stats.json -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+AllowFoldMethods -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+ReportExceptionStackTraces -H:-AddAllCharsets --enable-url-protocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace -J--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner -jar quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'quarkus-integration-test-jpa-postgresql-999-SNAPSHOT-runner' (executable)...
========================================================================================================================
Warning: Feature class org.hibernate.graalvm.internal.QueryParsingSupport is annotated with the deprecated annotation @AutomaticFeature. Support for this annotation will be removed in a future version of GraalVM. Applications should register a feature using the option --features=org.hibernate.graalvm.internal.QueryParsingSupport
Warning: Feature class org.hibernate.graalvm.internal.GraalVMStaticAutofeature is annotated with the deprecated annotation @AutomaticFeature. Support for this annotation will be removed in a future version of GraalVM. Applications should register a feature using the option --features=org.hibernate.graalvm.internal.GraalVMStaticAutofeature
[1/7] Initializing... (9.5s @ 0.32GB)
Version info: 'GraalVM 22.3.0-dev Java 17 Mandrel Distribution'
Java version info: '17.0.4.1-internal+0-adhoc.sgehwolf.jdk17u'
C compiler: gcc (redhat, x86_64, 12.2.1)
Garbage collector: Serial GC
9 user-specific feature(s)
- io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
- io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.hibernate.Version, org.hibernate.annotations.common.Version, org.hibernate.dialect.Dialect] categories
- io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature
- io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
- io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.jboss.threads] categories
- io.quarkus.runtime.graal.ResourcesFeature: Register each line in META-INF/quarkus-native-resources.txt as a resource on Substrate VM
- org.graalvm.home.HomeFinderFeature: Finds GraalVM paths and its version number
- org.hibernate.graalvm.internal.GraalVMStaticAutofeature
- org.hibernate.graalvm.internal.QueryParsingSupport
[2/7] Performing analysis... [*******] (54.1s @ 2.92GB)
14,890 (89.48%) of 16,641 classes reachable
21,152 (58.99%) of 35,859 fields reachable
70,756 (52.31%) of 135,253 methods reachable
593 classes, 146 fields, and 2,157 methods registered for reflection
63 classes, 68 fields, and 55 methods registered for JNI access
4 native libraries: dl, pthread, rt, z
[...]
Output of uname -a
or ver
No response
Output of java -version
17
GraalVM version (if different from Java)
22.3.0-dev
Quarkus version or git rev
7270dc661fdf834fc3dcb0e4a2dad79b0c3fb8dc
Build tool (ie. output of mvnw --version
or gradlew --version
)
No response
Additional information
This probably needs a fix similar to a4724d578d850b66dd2c3a3d91e188c6333691c1 in hibernate code?
/cc @Karm, @Sanne, @galderz, @gsmet, @yrodiere, @zakkak
AFAIK @Sanne is aware of this and how to fix it.
Feel free to close if that work is already being tracked elsewhere.
It seems to have been fixed with: https://github.com/hibernate/hibernate-orm/commit/b57f4a6b12fdbe8607f10401b4f3337a914e771a (still unreleased)
Is this still an issue?
@geoand ah, I missed it - sorry it's probably fixed by the upgrade to ORM v. 5.6.12.Final
It was fixed by https://github.com/quarkusio/quarkus/pull/28221
Awesome, thanks