-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native image with liquibase on Windows 11 #33030
Comments
/cc @andrejpetras (liquibase), @geoand (liquibase), @gsmet (liquibase) |
I just built my project which uses Liquibase on Windows using 3.0.1 and its all working fine. See my project here: https://github.com/melloware/quarkus-monorepo |
Have you tried the repo which is the sample provided from quarkus I provided ? Is it because java 11..? I haven't have any success with your repo yet. |
Ahhh possibly I am using Docker and Mandrel. |
OK just tried that QuickStart with Docker/Mandrel and it builds a native image just fine.
|
@melloware if you use Docker, you're building on Linux. The issue might be specific to Windows given it's about low level JDK classes. |
I'm using Windows 10 and I get the same error, when I tried to build a native image with quickstart repository. Additional info: |
I confirm the bug (same behavior on two environments). Seems to be reproduce in doing on a windows machine git clone https://github.com/correctexam/corrigeExamBack.git
cd corrigeExamBack
mvnw -P"native,alone" clean package -DskipTests If it could help, it works well if I remove the following dependency. (No problem on mac and linux with this dependency) <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-liquibase</artifactId>
</dependency> Seems to be closed to this bug that seems to have been fixed but it could be seen as a regression. |
I can easily reproduce this issue on Quarkus 3.3.1 using the starter code generated from https://code.quarkus.io/ Almost the same issue with @barais, but the dependency used is <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-liquibase-mongodb</artifactId>
</dependency> No issues so far when compiling with linux x64 native, seems like isolated to windows x64 native builds. I also agree that this might be related to the same bug raised in this issue #22449, so not sure if the fix was only applied on Quarkus v2 and not ported to v3 Sample project: https://github.com/vincejv/playground/tree/89919bc9b96dbdb8faf1a21725c0574989e9fcd7 [2/8] Performing analysis... [*****] (153.0s @ 2.01GB)
18,014 (89.07%) of 20,225 types reachable
28,621 (64.07%) of 44,670 fields reachable
104,923 (62.26%) of 168,525 methods reachable
Error: No instances of java.lang.ProcessEnvironment are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use --trace-object-instantiation=java.lang.ProcessEnvironment.
5,887 types, 610 fields, and 8,746 methods registered for reflection
Detailed message:
Trace: Object was reached by
reading field java.util.Collections$UnmodifiableMap.m of constant
java.util.Collections$UnmodifiableMap@60f1a9d7: {Path=C:\Program Files\PowerShell\7;C:\hostedtoolcache\windows\graalvm-jdk-17_wi...
reading field liquibase.configuration.core.EnvironmentValueProvider.environment of constant
liquibase.configuration.core.EnvironmentValueProvider@2c4d2364: liquibase.configuration.core.EnvironmentValueProvider@2c4d2364
reading field java.util.TreeMap$Entry.key of constant
java.util.TreeMap$Entry@36b5cd86: liquibase.configuration.core.EnvironmentValueProvider@2c4d2364=java.lang.Object@...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@62dcca70: liquibase.configuration.core.SystemPropertyValueProvider@379dad63=java.lang.Obje...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@27d6813e: liquibase.configuration.core.DeprecatedConfigurationValueProvider@5a0c0a0b=java....
reading field java.util.TreeMap.root of constant
java.util.TreeMap@1[2608](https://github.com/vincejv/playground/actions/runs/6055879206/job/16435301791#step:6:2609)c14: {liquibase.configuration.core.EnvironmentValueProvider@2c4d2364=java.lang.Object...
reading field java.util.TreeSet.m of constant
java.util.TreeSet@5f8bb24e: [liquibase.configuration.core.EnvironmentValueProvider@2c4d2364, liquibase.confi...
reading field liquibase.configuration.LiquibaseConfiguration.configurationValueProviders of constant
liquibase.configuration.LiquibaseConfiguration@3a8460d1: liquibase.configuration.LiquibaseConfiguration@3a8460d1
reading field java.util.TreeMap$Entry.value of constant
java.util.TreeMap$Entry@715260d8: liquibase.configuration.LiquibaseConfiguration=liquibase.configuration.Liquibase...
reading field java.util.TreeMap$Entry.right of constant
java.util.TreeMap$Entry@2dac1aff: liquibase.configuration.ConfiguredValueModifierFactory=liquibase.configuration.C...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@2e2fca61: liquibase.logging.core.LogServiceFactory=liquibase.logging.core.LogServiceFactor...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@2b1e4cbb: resourceAccessor=ClassLoaderResourceAccessor{}
reading field java.util.TreeMap.root of constant
java.util.TreeMap@38058acd: {liquibase.command.CommandFactory=liquibase.command.CommandFactory@67ca15fc, liq...
reading field liquibase.util.SmartMap.values of constant
liquibase.util.SmartMap@6b9e54d8: liquibase.util.SmartMap@aad08fb6
reading field liquibase.Scope.values of constant
liquibase.Scope@139984e7: scope(database=null)
reading field liquibase.SingletonScopeManager.currentScope of constant
liquibase.SingletonScopeManager@2055a5cd: liquibase.SingletonScopeManager@2055a5cd
reading static field liquibase.Scope.scopeManager
at liquibase.Scope.getCurrentScope(Scope.java:76)
parsing method liquibase.Scope.getCurrentScope(Scope.java:76) reachable via the parsing context
at liquibase.plugin.AbstractPluginFactory.getPlugin(AbstractPluginFactory.java:41)
at liquibase.license.LicenseServiceFactory.getLicenseService(LicenseServiceFactory.java:21)
at root method.(Unknown Source)
com.oracle.svm.core.util.UserError$UserException: No instances of java.lang.ProcessEnvironment are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use --trace-object-instantiation=java.lang.ProcessEnvironment.
Detailed message:
Trace: Object was reached by
reading field java.util.Collections$UnmodifiableMap.m of constant
java.util.Collections$UnmodifiableMap@60f1a9d7: {Path=C:\Program Files\PowerShell\7;C:\hostedtoolcache\windows\graalvm-jdk-17_wi...
reading field liquibase.configuration.core.EnvironmentValueProvider.environment of constant
liquibase.configuration.core.EnvironmentValueProvider@2c4d2364: liquibase.configuration.core.EnvironmentValueProvider@2c4d2364
reading field java.util.TreeMap$Entry.key of constant
java.util.TreeMap$Entry@36b5cd86: liquibase.configuration.core.EnvironmentValueProvider@2c4d2364=java.lang.Object@...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@62dcca70: liquibase.configuration.core.SystemPropertyValueProvider@379dad63=java.lang.Obje...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@27d6813e: liquibase.configuration.core.DeprecatedConfigurationValueProvider@5a0c0a0b=java....
reading field java.util.TreeMap.root of constant
java.util.TreeMap@12608c14: {liquibase.configuration.core.EnvironmentValueProvider@2c4d2364=java.lang.Object...
reading field java.util.TreeSet.m of constant
java.util.TreeSet@5f8bb24e: [liquibase.configuration.core.EnvironmentValueProvider@2c4d2364, liquibase.confi...
reading field liquibase.configuration.LiquibaseConfiguration.configurationValueProviders of constant
liquibase.configuration.LiquibaseConfiguration@3a8460d1: liquibase.configuration.LiquibaseConfiguration@3a8460d1
reading field java.util.TreeMap$Entry.value of constant
java.util.TreeMap$Entry@715260d8: liquibase.configuration.LiquibaseConfiguration=liquibase.configuration.Liquibase...
reading field java.util.TreeMap$Entry.right of constant
java.util.TreeMap$Entry@2dac1aff: liquibase.configuration.ConfiguredValueModifierFactory=liquibase.configuration.C...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@2e2fca61: liquibase.logging.core.LogServiceFactory=liquibase.logging.core.LogServiceFactor...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@2b1e4cbb: resourceAccessor=ClassLoaderResourceAccessor{}
reading field java.util.TreeMap.root of constant
java.util.TreeMap@38058acd: {liquibase.command.CommandFactory=liquibase.command.CommandFactory@67ca15fc, liq...
reading field liquibase.util.SmartMap.values of constant
liquibase.util.SmartMap@6b9e54d8: liquibase.util.SmartMap@aad08fb6
reading field liquibase.Scope.values of constant
liquibase.Scope@139984e7: scope(database=null)
reading field liquibase.SingletonScopeManager.currentScope of constant
liquibase.SingletonScopeManager@2055a5cd: liquibase.SingletonScopeManager@2055a5cd
reading static field liquibase.Scope.scopeManager
at liquibase.Scope.getCurrentScope(Scope.java:76)
parsing method liquibase.Scope.getCurrentScope(Scope.java:76) reachable via the parsing context
at liquibase.plugin.AbstractPluginFactory.getPlugin(AbstractPluginFactory.java:41)
at liquibase.license.LicenseServiceFactory.getLicenseService(LicenseServiceFactory.java:21)
at root method.(Unknown Source)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:85)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:248)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:798)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:582)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:539)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:408)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:612)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:134)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:94)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of java.lang.ProcessEnvironment are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use --trace-object-instantiation=java.lang.ProcessEnvironment.
Detailed message:
Trace: Object was reached by
reading field java.util.Collections$UnmodifiableMap.m of constant
java.util.Collections$UnmodifiableMap@60f1a9d7: {Path=C:\Program Files\PowerShell\7;C:\hostedtoolcache\windows\graalvm-jdk-17_wi...
reading field liquibase.configuration.core.EnvironmentValueProvider.environment of constant
liquibase.configuration.core.EnvironmentValueProvider@2c4d2364: liquibase.configuration.core.EnvironmentValueProvider@2c4d2364
reading field java.util.TreeMap$Entry.key of constant
java.util.TreeMap$Entry@36b5cd86: liquibase.configuration.core.EnvironmentValueProvider@2c4d2364=java.lang.Object@...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@62dcca70: liquibase.configuration.core.SystemPropertyValueProvider@379dad63=java.lang.Obje...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@27d6813e: liquibase.configuration.core.DeprecatedConfigurationValueProvider@5a0c0a0b=java....
reading field java.util.TreeMap.root of constant
java.util.TreeMap@12608c14: {liquibase.configuration.core.EnvironmentValueProvider@2c4d2364=java.lang.Object...
reading field java.util.TreeSet.m of constant
java.util.TreeSet@5f8bb24e: [liquibase.configuration.core.EnvironmentValueProvider@2c4d2364, liquibase.confi...
reading field liquibase.configuration.LiquibaseConfiguration.configurationValueProviders of constant
liquibase.configuration.LiquibaseConfiguration@3a8460d1: liquibase.configuration.LiquibaseConfiguration@3a8460d1
reading field java.util.TreeMap$Entry.value of constant
java.util.TreeMap$Entry@715260d8: liquibase.configuration.LiquibaseConfiguration=liquibase.configuration.Liquibase...
reading field java.util.TreeMap$Entry.right of constant
java.util.TreeMap$Entry@2dac1aff: liquibase.configuration.ConfiguredValueModifierFactory=liquibase.configuration.C...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@2e2fca61: liquibase.logging.core.LogServiceFactory=liquibase.logging.core.LogServiceFactor...
reading field java.util.TreeMap$Entry.left of constant
java.util.TreeMap$Entry@2b1e4cbb: resourceAccessor=ClassLoaderResourceAccessor{}
reading field java.util.TreeMap.root of constant
java.util.TreeMap@38058acd: {liquibase.command.CommandFactory=liquibase.command.CommandFactory@67ca15fc, liq...
reading field liquibase.util.SmartMap.values of constant
liquibase.util.SmartMap@6b9e54d8: liquibase.util.SmartMap@aad08fb6
reading field liquibase.Scope.values of constant
liquibase.Scope@139984e7: scope(database=null)
reading field liquibase.SingletonScopeManager.currentScope of constant
liquibase.SingletonScopeManager@2055a5cd: liquibase.SingletonScopeManager@2055a5cd
reading static field liquibase.Scope.scopeManager
at liquibase.Scope.getCurrentScope(Scope.java:76)
parsing method liquibase.Scope.getCurrentScope(Scope.java:76) reachable via the parsing context
at liquibase.plugin.AbstractPluginFactory.getPlugin(AbstractPluginFactory.java:41)
at liquibase.license.LicenseServiceFactory.getLicenseService(LicenseServiceFactory.java:21)
at root method.(Unknown Source)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:126)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:793)
... 6 more
83 types, 78 fields, and 68 methods registered for JNI access
5 native libraries: crypt32, ncrypt, psapi, version, winhttp |
After checking with the source code for v3, seems like the fix done on #22449 was not ported over to Quarkus 3. I'm sure this is currently on low priority as this is isolated on windows, but if no one will shoot a PR, I would gladly do it myself in my free time given this has been unresolved since Quarkus 3.0.1, May 1, 2023. |
Quarkus 3 was branched well after 2.10 so any patch in 2.10 would be in 3. This particular code might have been removed for whatever reason but it’s not as simple as « it wasn’t ported ». |
Including a class like this will fix your local builds. It is basically the same as #22449, but I had to change the target class slightly to
|
Describe the bug
Expected behavior
Native image should be produced.
Actual behavior
No response
How to Reproduce?
https://github.com/quarkusio/quarkus-quickstarts/tree/main/liquibase-quickstart
Output of
uname -a
orver
Microsoft Windows [Version 10.0.22621.1555]
Output of
java -version
openjdk version "11.0.17" 2022-10-18 LTS OpenJDK Runtime Environment Zulu11.60+19-CA (build 11.0.17+8-LTS) OpenJDK 64-Bit Server VM Zulu11.60+19-CA (build 11.0.17+8-LTS, mixed mode)
GraalVM version (if different from Java)
openjdk version "11.0.19" 2023-04-18 OpenJDK Runtime Environment GraalVM CE 22.3.2 (build 11.0.19+7-jvmci-22.3-b18) OpenJDK 64-Bit Server VM GraalVM CE 22.3.2 (build 11.0.19+7-jvmci-22.3-b18, mixed mode, sharing)
Quarkus version or git rev
3.0.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6
Java version: 11.0.17, vendor: Azul Systems, Inc., runtime: C:\Users\manoj.sdkman\candidates\java\11.0.17.fx-zulu Default locale: en_IE, platform encoding: Cp1252 OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: