Skip to content
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

Open GraalVM internals to the ConstantFieldFeature #28732

Conversation

mhalbritter
Copy link
Contributor

This is needed as GraalVM 22.2 enabled the module system when building
native-images and all plugins have to participate in it.

Fixes this exception:

Fatal error: java.lang.IllegalAccessError: class org.springframework.aot.graalvm.ConstantFieldFeature (in unnamed module @0x60f2e150) cannot access class com.oracle.svm.hosted.FeatureImpl$DuringSetupAccessImpl (in module org.graalvm.nativeimage.builder) because module org.graalvm.nativeimage.builder does not export com.oracle.svm.hosted to unnamed module @0x60f2e150
        at org.springframework.aot.graalvm.ConstantFieldFeature.duringSetup(ConstantFieldFeature.java:37)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.lambda$setupNativeImage$16(NativeImageGenerator.java:899)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:78)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:899)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:561)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:521)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)

This is needed as GraalVM 22.2 enabled the module system when building
native-images and all plugins have to participate in it.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 30, 2022
@sdeleuze sdeleuze added this to the 6.0.0-M5 milestone Jun 30, 2022
@sdeleuze sdeleuze added theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 30, 2022
@sdeleuze sdeleuze self-assigned this Jun 30, 2022
@sdeleuze sdeleuze closed this in 1a88451 Jun 30, 2022
@mhalbritter mhalbritter deleted the mh/workaround-graalvm-jpms branch June 30, 2022 08:10
sdeleuze pushed a commit to sdeleuze/spring-framework that referenced this pull request Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants