oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.4k stars 1.64k forks source link

"VMError$HostedError: should not reach here" #4563

Closed TheMode closed 2 years ago

TheMode commented 2 years ago

Describe the issue Building a jar end up with the exception VMError$HostedError: should not reach here. Log indicate that some constructors present in my reflection config file are not present (which in my opinion, should be silently ignored even if it is the case)

Code is available here

Steps to reproduce the issue

  1. Download the jar
  2. Run native-image -jar arena.jar --allow-incomplete-classpath

Describe GraalVM and your environment:

More details

native-image -jar arena.jar --allow-incomplete-classpath --native-image-info --verbose
Executing [
'C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\bin\java.exe' \
-XX:+UseParallelGC \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
--add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.access.foreign=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.event=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.loader=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.logger=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.module=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.org.xml.sax.helpers=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.perf=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.platform=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.util.xml.impl=ALL-UNNAMED \
--add-exports=java.base/jdk.internal.util.xml=ALL-UNNAMED \
--add-exports=java.base/sun.invoke.util=ALL-UNNAMED \
--add-exports=java.base/sun.net=ALL-UNNAMED \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-exports=java.base/sun.reflect.annotation=ALL-UNNAMED \
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED \
--add-exports=java.base/sun.reflect.generics.repository=ALL-UNNAMED \
--add-exports=java.base/sun.reflect.generics.tree=ALL-UNNAMED \
--add-exports=java.base/sun.security.jca=ALL-UNNAMED \
--add-exports=java.base/sun.security.provider=ALL-UNNAMED \
--add-exports=java.base/sun.security.ssl=ALL-UNNAMED \
--add-exports=java.base/sun.security.util=ALL-UNNAMED \
--add-exports=java.base/sun.text.spi=ALL-UNNAMED \
--add-exports=java.base/sun.util.calendar=ALL-UNNAMED \
--add-exports=java.base/sun.util.locale.provider=ALL-UNNAMED \
--add-exports=java.base/sun.util.resources=ALL-UNNAMED \
--add-exports=java.management/sun.management=ALL-UNNAMED \
--add-exports=java.xml.crypto/org.jcp.xml.dsig.internal.dom=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \
--add-exports=jdk.jfr/jdk.jfr.events=ALL-UNNAMED \
--add-exports=jdk.jfr/jdk.jfr.internal.consumer=ALL-UNNAMED \
--add-exports=jdk.jfr/jdk.jfr.internal.handlers=ALL-UNNAMED \
--add-exports=jdk.jfr/jdk.jfr.internal.jfc=ALL-UNNAMED \
--add-exports=jdk.jfr/jdk.jfr.internal=ALL-UNNAMED \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx14g \
-Djava.awt.headless=true \
-Dorg.graalvm.version=22.0.0.2 \
-Dorg.graalvm.config=CE \
-Dcom.oracle.graalvm.isaot=true \
-Djava.system.class.loader=com.oracle.svm.hosted.NativeImageSystemClassLoader \
-Xshare:off \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
'-javaagent:C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\builder\svm.jar' \
-cp \
'C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\builder\native-image-base.jar;C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\builder\objectfile.jar;C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\builder\pointsto.jar;C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\builder\svm.jar' \
--module-path \
'C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\truffle\truffle-api.jar' \
'com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus' \
-imagecp \
'C:\Users\TheMode-PC\Desktop\test graalvm\arena.jar;C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\library-support.jar' \
'-H:Path=C:\Users\TheMode-PC\Desktop\test graalvm' \
'-H:Class@manifest from file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar=net.minestom.arena.Main' \
'-H:Name@manifest from file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar=arena' \
'-H:JNIConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/jansi/jni-config.json=META-INF/native-image/jansi/jni-config.json' \
'-H:JNIConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/minestom/jni-config.json=META-INF/native-image/minestom/jni-config.json' \
'-H:ReflectionConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/minestom/reflect-config.json=META-INF/native-image/minestom/reflect-config.json' \
'-H:ResourceConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/jansi/resource-config.json=META-INF/native-image/jansi/resource-config.json' \
'-H:ResourceConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/jline/resource-config.json=META-INF/native-image/jline/resource-config.json' \
'-H:ResourceConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/minestom/resource-config.json=META-INF/native-image/minestom/resource-config.json' \
'-H:DynamicProxyConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/minestom/proxy-config.json=META-INF/native-image/minestom/proxy-config.json' \
'-H:SerializationConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/minestom/serialization-config.json=META-INF/native-image/minestom/serialization-config.json' \
'-H:PredefinedClassesConfigurationResources@jar:file:///C:/Users/TheMode-PC/Desktop/test%20graalvm/arena.jar!/META-INF/native-image/minestom/predefined-classes-config.json=META-INF/native-image/minestom/predefined-classes-config.json' \
-H:+AllowIncompleteClasspath \
-H:+DumpTargetInfo \
'-H:CLibraryPath=C:\Program Files\Java\graalvm-ce-java17-22.0.0.2\lib\svm\clibraries\windows-amd64'
]
========================================================================================================================
GraalVM Native Image: Generating 'arena'...
========================================================================================================================
[1/7] Initializing...                                                                                    (8,5s @ 0,33GB)
Warning: Method com.github.benmanes.caffeine.cache.SIW.<init>(Caffeine, CacheLoader, boolean) not found.
Warning: Method com.github.benmanes.caffeine.cache.SSW.<init>(Caffeine, CacheLoader, boolean) not found.
Warning: Method com.github.benmanes.caffeine.cache.WI.<init>(Caffeine, CacheLoader, boolean) not found.
Warning: Method com.github.benmanes.caffeine.cache.WS.<init>(Caffeine, CacheLoader, boolean) not found.
 Version info: 'GraalVM 22.0.0.2 Java 17 CE'
 2 user-provided feature(s)
  - com.oracle.svm.polyglot.kotlin.KotlinFeature
  - com.oracle.svm.thirdparty.gson.GsonFeature
# Printing compilation-target information to: C:\Users\TheMode-PC\Desktop\test graalvm\reports\target_info_20220510_213416.txt
[2/7] Performing analysis...  [********]                                                                (37,9s @ 4,14GB)
# Printing native-library information to: C:\Users\TheMode-PC\Desktop\test graalvm\reports\native_library_info_20220510_213454.txt
  15?290 (96,41%) of 15?860 classes reachable
  27?917 (72,32%) of 38?602 fields reachable
  69?699 (84,22%) of 82?759 methods reachable
     449 classes,   791 fields, and   964 methods registered for reflection
      99 classes,   209 fields, and   149 methods registered for JNI access
[3/7] Building universe...                                                                               (3,1s @ 2,37GB)
[4/7] Parsing methods...      [*]                                                                        (1,6s @ 3,98GB)
[5/7] Inlining methods...     [*****]                                                                    (4,2s @ 1,66GB)
[6/7] Compiling methods...    [*****]                                                                   (21,7s @ 2,00GB)
[7/7] Creating image...
Fatal error: com.oracle.svm.core.util.VMError$HostedError: should not reach here
        at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:64)
        at com.oracle.svm.hosted.jdk.JNIRegistrationSupport.makeShimDLL(JNIRegistrationSupport.java:256)
        at com.oracle.svm.hosted.jdk.JNIRegistrationSupport.makeShimDLLs(JNIRegistrationSupport.java:230)
        at com.oracle.svm.hosted.jdk.JNIRegistrationSupport.afterImageWrite(JNIRegistrationSupport.java:175)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$8(NativeImageGenerator.java:680)
        at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:74)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:680)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
------------------------------------------------------------------------------------------------------------------------
                        8,4s (9,5% of total time) in 47 GCs | Peak RSS: 7,50GB | CPU load: 10,05
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 C:\Users\TheMode-PC\Desktop\test graalvm\arena.exe (executable)
 C:\Users\TheMode-PC\Desktop\test graalvm\awt.dll (jdk_lib)
 C:\Users\TheMode-PC\Desktop\test graalvm\javajpeg.dll (jdk_lib)
 C:\Users\TheMode-PC\Desktop\test graalvm\lcms.dll (jdk_lib)
 C:\Users\TheMode-PC\Desktop\test graalvm\arena.build_artifacts.txt
========================================================================================================================
Failed generating 'arena' after 1m 27s.
Error: Image build request failed with exit status 1
com.oracle.svm.driver.NativeImage$NativeImageError: Image build request failed with exit status 1
        at com.oracle.svm.driver.NativeImage.showError(NativeImage.java:1770)
        at com.oracle.svm.driver.NativeImage.build(NativeImage.java:1477)
        at com.oracle.svm.driver.NativeImage.performBuild(NativeImage.java:1438)
        at com.oracle.svm.driver.NativeImage.main(NativeImage.java:1425)
pejovica commented 2 years ago

This is a duplicate of #4072, which has been fixed in the recently released GraalVM 22.1.

firatgursoy commented 1 year ago

This is a duplicate of #4072, which has been fixed in the recently released GraalVM 22.1.

Unfortunately not. Still getting same error on 22.3.0

Redhab commented 1 year ago

Getting similar issue with the latest version 22.3.0 on simple Spring Boot 3.0.0 demo project:

[native-image-plugin] GraalVM Toolchain detection is enabled
[native-image-plugin] GraalVM uses toolchain detection. Selected:
[native-image-plugin]    - language version: 17
[native-image-plugin]    - vendor: GraalVM Community
[native-image-plugin]    - runtime version: 17.0.5+8-jvmci-22.3-b08
[native-image-plugin] Native Image executable path: C:\Java\graalvm\ce-java17-22.3.0\bin\native-image.cmd
=======================================================================================================================
GraalVM Native Image: Generating demo (executable)...
========================================================================================================================
Warning: Could not resolve [Lorg.apache.logging.log4j.core.Appender; for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.Appender.
Warning: Could not resolve [Lorg.apache.logging.log4j.core.config.AppenderControl; for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.AppenderControl.
Warning: Could not resolve [Lorg.apache.logging.log4j.core.config.AppenderRef; for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.AppenderRef.
Warning: Could not resolve [Lorg.apache.logging.log4j.core.config.LoggerConfig; for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.LoggerConfig.
Warning: Could not resolve [Lorg.apache.logging.log4j.core.config.Property; for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.config.Property.
Warning: Could not resolve [Lorg.apache.logging.log4j.core.pattern.PatternFormatter; for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.pattern.PatternFormatter.
Warning: Could not resolve jakarta.enterprise.inject.spi.BeanManager for reflection configuration. Reason: java.lang.ClassNotFoundException: jakarta.enterprise.inject.spi.BeanManager.
Warning: Could not resolve org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy for reflection configuration. Reason: java.lang.ClassNotFoundException: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy.
Warning: Could not resolve org.wildfly.transaction.client.ContextTransactionManager for reflection configuration. Reason: java.lang.ClassNotFoundException: org.wildfly.transaction.client.ContextTransactionManager.
Warning: Could not resolve org.wildfly.transaction.client.ContextTransactionManager for reflection configuration. Reason: java.lang.ClassNotFoundException: org.wildfly.transaction.client.ContextTransactionManager.
Warning: Could not resolve org.wildfly.transaction.client.LocalUserTransaction for reflection configuration. Reason: java.lang.ClassNotFoundException: org.wildfly.transaction.client.LocalUserTransaction.
Warning: Could not resolve org.jboss.logmanager.LogManager for reflection configuration. Reason: java.lang.ClassNotFoundException: org.jboss.logmanager.LogManager.
Warning: Method com.zaxxer.hikari.HikariConfig.getScheduledExecutorService() not found.
Warning: Method com.zaxxer.hikari.HikariConfig.isInitializationFailFast() not found.
Warning: Method com.zaxxer.hikari.HikariConfig.isJdbc4ConnectionTest() not found.
Warning: Method com.zaxxer.hikari.HikariConfig.setInitializationFailFast(boolean) not found.
Warning: Method com.zaxxer.hikari.HikariConfig.setJdbc4ConnectionTest(boolean) not found.
Warning: Method com.zaxxer.hikari.HikariConfig.setScheduledExecutorService(ScheduledThreadPoolExecutor) not found.
Warning: Could not resolve com.sun.el.ExpressionFactoryImpl for reflection configuration. Reason: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl.
Warning: Could not resolve groovy.grape.GrabAnnotationTransformation for reflection configuration. Reason: java.lang.ClassNotFoundException: groovy.grape.GrabAnnotationTransformation.
Warning: Could not resolve groovy.lang.Script for reflection configuration. Reason: java.lang.ClassNotFoundException: groovy.lang.Script.
Warning: Could not resolve groovy.lang.Script for reflection configuration. Reason: java.lang.ClassNotFoundException: groovy.lang.Script.
Warning: Could not resolve groovyjarjarantlr.CommonToken for reflection configuration. Reason: java.lang.ClassNotFoundException: groovyjarjarantlr.CommonToken.
Warning: Could not resolve javafx.beans.value.ObservableValue for reflection configuration. Reason: java.lang.ClassNotFoundException: javafx.beans.value.ObservableValue.
Warning: Could not resolve javax.money.MonetaryAmount for reflection configuration. Reason: java.lang.ClassNotFoundException: javax.money.MonetaryAmount.
Warning: Could not resolve org.codehaus.groovy.antlr.GroovySourceAST for reflection configuration. Reason: java.lang.ClassNotFoundException: org.codehaus.groovy.antlr.GroovySourceAST.
Warning: Could not resolve org.codehaus.groovy.ast.builder.AstBuilderTransformation for reflection configuration. Reason: java.lang.ClassNotFoundException: org.codehaus.groovy.ast.builder.AstBuilderTransformation.
Warning: Could not resolve org.codehaus.groovy.runtime.ScriptBytecodeAdapter for reflection configuration. Reason: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.ScriptBytecodeAdapter.
Warning: Could not resolve org.glassfish.expressly.ValueExpressionImpl for reflection configuration. Reason: java.lang.ClassNotFoundException: org.glassfish.expressly.ValueExpressionImpl.
Warning: Could not resolve org.glassfish.expressly.parser.AstValue for reflection configuration. Reason: java.lang.ClassNotFoundException: org.glassfish.expressly.parser.AstValue.
Warning: Could not resolve org.joda.time.ReadableInstant for reflection configuration. Reason: java.lang.ClassNotFoundException: org.joda.time.ReadableInstant.
Warning: Could not register method org.hibernate.validator.internal.constraintvalidators.bv.time.future.FutureValidatorForReadablePartial.<init>() for reflection. Reason: java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant.
Warning: Could not register method org.hibernate.validator.internal.constraintvalidators.bv.time.futureorpresent.FutureOrPresentValidatorForReadablePartial.<init>() for reflection. Reason: java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant.
Warning: Could not register method org.hibernate.validator.internal.constraintvalidators.bv.time.past.PastValidatorForReadablePartial.<init>() for reflection. Reason: java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant.
Warning: Could not register method org.hibernate.validator.internal.constraintvalidators.bv.time.pastorpresent.PastOrPresentValidatorForReadablePartial.<init>() for reflection. Reason: java.lang.NoClassDefFoundError: org/joda/time/ReadableInstant.
Warning: Could not resolve org.springframework.boot.devtools.env.DevToolsPropertyDefaultsPostProcessor for reflection configuration. Reason: java.lang.ClassNotFoundException: org.springframework.boot.devtools.env.DevToolsPropertyDefaultsPostProcessor.
Warning: Could not resolve org.springframework.boot.devtools.restart.RestartApplicationListener for reflection configuration. Reason: java.lang.ClassNotFoundException: org.springframework.boot.devtools.restart.RestartApplicationListener.
Warning: Could not resolve org.springframework.boot.devtools.logger.DevToolsLogFactory$Listener for reflection configuration. Reason: java.lang.ClassNotFoundException: org.springframework.boot.devtools.logger.DevToolsLogFactory$Listener.
Warning: Could not resolve org.springframework.boot.devtools.restart.RestartScopeInitializer for reflection configuration. Reason: java.lang.ClassNotFoundException: org.springframework.boot.devtools.restart.RestartScopeInitializer.
Warning: Could not resolve org.springframework.boot.devtools.env.DevToolsHomePropertiesPostProcessor for reflection configuration. Reason: java.lang.ClassNotFoundException: org.springframework.boot.devtools.env.DevToolsHomePropertiesPostProcessor.
[1/7] Initializing...                                                                                   (11.0s @ 0.31GB
 Version info: 'GraalVM 22.3.0 Java 17 CE'
 Java version info: '17.0.5+8-jvmci-22.3-b08'
 C compiler: cl.exe (microsoft, x64, 19.34.31935)
 Garbage collector: Serial GC
 1 user-specific feature(s)
 - org.springframework.aot.nativex.feature.PreComputeFieldFeature
The bundle named: org.apache.el.Messages, has not been found. If the bundle is part of a module, verify the bundle name is a fully qualified class name. Otherwise verify the bundle path is accessible in the classpath.
Field org.apache.commons.logging.LogAdapter#log4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#log4jSlf4jProviderPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jSpiPresent set to true at build time
Field org.apache.commons.logging.LogAdapter#slf4jApiPresent set to true at build time
Field org.springframework.core.NativeDetector#imageCode set to true at build time
Field org.springframework.core.KotlinDetector#kotlinPresent set to false at build time
Field org.springframework.core.KotlinDetector#kotlinReflectPresent set to false at build time
Field org.springframework.format.support.DefaultFormattingConversionService#jsr354Present set to false at build time
Field org.springframework.cglib.core.AbstractClassGenerator#imageCode set to true at build time
Field org.springframework.boot.logging.log4j2.Log4J2LoggingSystem$Factory#PRESENT set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#romePresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jaxb2Present set to true at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2Present set to true at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2XmlPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2SmilePresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jackson2CborPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#gsonPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#jsonbPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationCborPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystem$Factory#PRESENT set to true at build time
Field org.springframework.data.util.NullableWrapperConverters#GUAVA_PRESENT set to false at build time
Field org.springframework.data.util.NullableWrapperConverters#SCALA_PRESENT set to false at build time
Field org.springframework.data.util.NullableWrapperConverters#VAVR_PRESENT set to false at build time
Field org.springframework.boot.logging.java.JavaLoggingSystem$Factory#PRESENT set to true at build time
SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Field org.springframework.data.repository.util.QueryExecutionConverters#VAVR_PRESENT set to false at build time
Field org.springframework.security.config.annotation.web.builders.HttpSecurity#mvcPresent set to true at build time
Field org.springframework.boot.logging.logback.LogbackLoggingSystemProperties#JBOSS_LOGGING_PRESENT set to true at build time
Field org.springframework.data.util.ReactiveWrappers#PROJECT_REACTOR_PRESENT set to false at build time
Field org.springframework.data.util.ReactiveWrappers#RXJAVA3_PRESENT set to false at build time
Field org.springframework.data.util.ReactiveWrappers#KOTLIN_COROUTINES_PRESENT set to false at build time
Field org.springframework.data.util.ReactiveWrappers#MUTINY_PRESENT set to false at build time
Field org.springframework.data.repository.util.ReactiveWrapperConverters#RXJAVA3_PRESENT set to false at build time
Field org.springframework.data.repository.util.ReactiveWrapperConverters#REACTOR_PRESENT set to false at build time
Field org.springframework.data.repository.util.ReactiveWrapperConverters#KOTLIN_COROUTNES_PRESENT set to false at build time
Field org.springframework.data.repository.util.ReactiveWrapperConverters#MUTINY_PRESENT set to false at build time
Field org.springframework.web.context.support.StandardServletEnvironment#jndiPresent set to true at build time
Field org.springframework.web.context.support.WebApplicationContextUtils#jsfPresent set to false at build time
Field org.springframework.web.context.request.RequestContextHolder#jsfPresent set to false at build time
Field org.springframework.web.servlet.view.InternalResourceViewResolver#jstlPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jaxb2Present set to true at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2Present set to true at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2XmlPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jackson2SmilePresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#gsonPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#jsonbPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationCborPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.transaction.interceptor.TransactionAspectSupport#vavrPresent set to false at build time
Field org.springframework.transaction.interceptor.TransactionAspectSupport#reactiveStreamsPresent set to false at build time
Field org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator#USER_PROVIDED_ERROR_CODES_FILE_PRESENT set to false at build time
Field org.springframework.context.event.ApplicationListenerMethodAdapter#reactiveStreamsPresent set to false at build time
Field org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry#mvcPresent set to true at build time
Field org.springframework.boot.jdbc.DataSourceUnwrapper#DELEGATING_DATA_SOURCE_PRESENT set to true at build time
Field org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#jta12Present set to true at build time
Field org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#ejb3Present set to false at build time
Field org.springframework.boot.autoconfigure.web.format.WebConversionService#JSR_354_PRESENT set to false at build time
Field org.springframework.web.servlet.config.annotation.ResourceChainRegistration#isWebJarsAssetLocatorPresent set to true at build time
Field org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler#isContextPropagationPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#reactorPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#rxjava3Present set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#kotlinCoroutinesPresent set to false at build time
Field org.springframework.core.ReactiveAdapterRegistry#mutinyPresent set to false at build time
Field org.springframework.web.client.RestTemplate#romePresent set to false at build time
Field org.springframework.web.client.RestTemplate#jaxb2Present set to true at build time
Field org.springframework.web.client.RestTemplate#jackson2Present set to true at build time
Field org.springframework.web.client.RestTemplate#jackson2XmlPresent set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2SmilePresent set to false at build time
Field org.springframework.web.client.RestTemplate#jackson2CborPresent set to false at build time
Field org.springframework.web.client.RestTemplate#gsonPresent set to false at build time
Field org.springframework.web.client.RestTemplate#jsonbPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationCborPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationJsonPresent set to false at build time
Field org.springframework.web.client.RestTemplate#kotlinSerializationProtobufPresent set to false at build time
Field org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver#AGENT_CLASS_PRESENT set to false at build time
Field org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvoker#IS_REACTOR_PRESENT set to false at build time
Field org.springframework.boot.actuate.endpoint.web.annotation.DiscoveredWebOperation#REACTIVE_STREAMS_PRESENT set to false at build time
Field org.springframework.boot.actuate.endpoint.invoke.reflect.OperationMethodParameter#jsr305Present set to false at build time
Field org.springframework.security.oauth2.core.http.converter.HttpMessageConverters#jackson2Present set to true at build time
Field org.springframework.security.oauth2.core.http.converter.HttpMessageConverters#gsonPresent set to false at build time
Field org.springframework.security.oauth2.core.http.converter.HttpMessageConverters#jsonbPresent set to false at build time
Field org.springframework.web.servlet.support.RequestContext#jstlPresent set to false at build time
[2/7] Performing analysis...  [**********]                                                              (52.9s @ 4.60GB
  35,893 (93.93%) of 38,212 classes reachable
  60,388 (71.48%) of 84,478 fields reachable
 169,149 (62.52%) of 270,536 methods reachable
   1,893 classes, 2,056 fields, and 11,470 methods registered for reflection
      85 classes,    78 fields, and    70 methods registered for JNI access
       5 native libraries: crypt32, ncrypt, psapi, version, winhttp
[3/7] Building universe...                                                                               (7.1s @ 3.03GB)
[4/7] Parsing methods...      [**]                                                                       (2.5s @ 3.18GB)
[5/7] Inlining methods...     [****]                                                                     (1.7s @ 4.68GB)
[6/7] Compiling methods...    [****]                                                                    (16.7s @ 5.39GB)

[7/7] Creating image...                                                                                  (0.0s @ 6.15GB)
Fatal error: com.oracle.svm.core.util.VMError$HostedError: should not reach here
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:64)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.jdk.JNIRegistrationSupport.makeShimDLL(JNIRegistrationSupport.java:273)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.jdk.JNIRegistrationSupport.makeShimDLLs(JNIRegistrationSupport.java:247)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.jdk.JNIRegistrationSupport.afterImageWrite(JNIRegistrationSupport.java:192)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$8(NativeImageGenerator.java:724)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:85)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:724)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:535)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
------------------------------------------------------------------------------------------------------------------------
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:580)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
                       11.3s (10.7% of total time) in 63 GCs | Peak RSS: 8.83GB | CPU load: 5.12
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\awt.dll (jdk_lib)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\demo.build_artifacts.txt (txt)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\demo.exe (executable)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\jaas.dll (jdk_lib)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\javaaccessbridge.dll (jdk_lib)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\javajpeg.dll (jdk_lib)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\jawt.dll (jdk_lib)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\lcms.dll (jdk_lib)
 H:\projects\SpringBoot3\demo\build\native\nativeCompile\w2k_lsa_auth.dll (jdk_lib)
========================================================================================================================
Failed generating 'demo' after 1m 44s.
Error: Image build request failed with exit status 1

> Task :nativeCompile FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':nativeCompile'.
> Process 'command 'C:\Java\graalvm\ce-java17-22.3.0\bin\native-image.cmd'' finished with non-zero exit value 1
mageddo commented 1 year ago

I'm getting this same issue and not using Spring, it's confusing because I got this error and the binaries were generated?!

Version info: 'GraalVM 22.3.1 Java 19 CE'
 Java version info: '19.0.2+7-jvmci-22.3-b12'
 C compiler: cl.exe (microsoft, x64, 19.34.31942)
 Garbage collector: Serial GC
[2/7] Performing analysis...  [*******]                                                                (107.6s @ 1.41GB)
  12,084 (89.[67](https://github.com/mageddo/dns-proxy-server/actions/runs/4411856810/jobs/7730831284#step:6:68)%) of 13,476 classes reachable
  20,489 (65.14%) of 31,455 fields reachable
  64,097 (61.21%) of 104,716 methods reachable
     757 classes, 1,730 fields, and 6,160 methods registered for reflection
     120 classes,    95 fields, and 1,753 methods registered for JNI access
       4 native libraries: crypt32, ncrypt, version, winhttp
[3/7] Building universe...                                                                              (15.0s @ 2.27GB)
[4/7] Parsing methods...      [***]                                                                     (11.7s @ 1.54GB)
[5/7] Inlining methods...     [***]                                                                      (7.0s @ 1.90GB)
[6/7] Compiling methods...    [*********]                                                               (92.3s @ 1.[69](https://github.com/mageddo/dns-proxy-server/actions/runs/4411856810/jobs/7730831284#step:6:70)GB)

[7/7] Creating image...                                                                                  (0.0s @ 2.34GB)
------------------------------------------------------------------------------------------------------------------------
Fatal error: com.oracle.svm.core.util.VMError$HostedError: should not reach here
    at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:64)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.jdk.JNIRegistrationSupport.makeShimDLL(JNIRegistrationSupport.java:273)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.jdk.JNIRegistrationSupport.makeShimDLLs(JNIRegistrationSupport.java:247)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.jdk.JNIRegistrationSupport.afterImageWrite(JNIRegistrationSupport.java:192)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$8(NativeImageGenerator.java:[72](https://github.com/mageddo/dns-proxy-server/actions/runs/4411856810/jobs/7730831284#step:6:73)4)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:85)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:724)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:535)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:5[80](https://github.com/mageddo/dns-proxy-server/actions/runs/4411856810/jobs/7730831284#step:6:81))
    at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
                        14.4s (4.8% of total time) in 56 GCs | Peak RSS: 3.51GB | CPU load: 1.65
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 D:\a\dns-proxy-server\dns-proxy-server\tmp\awt.dll (jdk_lib)
 D:\a\dns-proxy-server\dns-proxy-server\tmp\dns-proxy-server.build_artifacts.txt (txt)
 D:\a\dns-proxy-server\dns-proxy-server\tmp\dns-proxy-server.exe (executable)

See the logs https://github.com/mageddo/dns-proxy-server/actions/runs/4411856810/jobs/7730831284

mageddo commented 1 year ago

Related to #5008

mageddo commented 1 year ago

Realized that native-image failed on generating the following DLLs , not sure if they are required , searching about that right now

 D:\a\dns-proxy-server\dns-proxy-server\java.dll (jdk_lib_shim)
 D:\a\dns-proxy-server\dns-proxy-server\jvm.dll (jdk_lib_shim)