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

ThrowMissingRegistrationErrors: AWT Desktop i18N, SPI for ImageIO #45176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Karm
Copy link
Member

@Karm Karm commented Dec 17, 2024

Fixes #44622
...although "fixes" is a rather too nice a statement. It feels like @zakkak reported a crack in a fine pottery and I provided a fix fit a hammer.

Resource bundles in java.awt.Toolkit

This is fine. All those resource bundles are for Desktop UI we don't support. Quarkus support int he core repo is strictly about server side image processing.

ImageIO SPI

I find this potentially problematic. If you write your own plugin and you would like to register it to be known at build time, this substitution cripples the ability to load it. The core test suite passes though.

Summary

The warnings, triggered as:

$ ./mvnw clean package -Dnative -Dnative.surefire.skip 
   -Dquarkus.native.enable-reports -pl integration-tests/awt 
   -Dquarkus.native.additional-build-args=-H:ThrowMissingRegistrationErrors= 

$  ./integration-tests/awt/target/quarkus-integration-test-awt-999-SNAPSHOT-runner -XX:MissingRegistrationReportingMode=Warn

Are all gone expect for those AWT unrelated:

com.oracle.svm.core.jdk.resources.MissingResourceRegistrationError: The program tried to access the resource at path

   application.properties

without it being registered as reachable. Add it to the resource metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources-and-resource-bundles for help
  java.base@23.0.1/java.lang.ClassLoader.getResources(ClassLoader.java:101)
  io.smallrye.common.classloader.ClassPathUtils.consumeAsPaths(ClassPathUtils.java:84)
  io.smallrye.config.AbstractLocationConfigSourceLoader.tryClassPath(AbstractLocationConfigSourceLoader.java:144)
  io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:107)


com.oracle.svm.core.jdk.resources.MissingResourceRegistrationError: The program tried to access the resource at path

   application.properties

without it being registered as reachable. Add it to the resource metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources-and-resource-bundles for help
  java.base@23.0.1/java.lang.ClassLoader.getResources(ClassLoader.java:102)
  io.smallrye.common.classloader.ClassPathUtils.consumeAsPaths(ClassPathUtils.java:84)
  io.smallrye.config.AbstractLocationConfigSourceLoader.tryClassPath(AbstractLocationConfigSourceLoader.java:144)
  io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:107)


com.oracle.svm.core.jdk.resources.MissingResourceRegistrationError: The program tried to access the resource at path

   META-INF/microprofile-config.properties

without it being registered as reachable. Add it to the resource metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources-and-resource-bundles for help
  java.base@23.0.1/java.lang.ClassLoader.getResources(ClassLoader.java:101)
  io.smallrye.common.classloader.ClassPathUtils.consumeAsPaths(ClassPathUtils.java:84)
  io.smallrye.config.AbstractLocationConfigSourceLoader.tryClassPath(AbstractLocationConfigSourceLoader.java:144)
  io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:107)


com.oracle.svm.core.jdk.resources.MissingResourceRegistrationError: The program tried to access the resource at path

   META-INF/microprofile-config.properties

without it being registered as reachable. Add it to the resource metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resources-and-resource-bundles for help
  java.base@23.0.1/java.lang.ClassLoader.getResources(ClassLoader.java:102)
  io.smallrye.common.classloader.ClassPathUtils.consumeAsPaths(ClassPathUtils.java:84)
  io.smallrye.config.AbstractLocationConfigSourceLoader.tryClassPath(AbstractLocationConfigSourceLoader.java:144)
  io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:107)

As you can see, the main config file for Quarkus is being looked up until it's found. I'd like to have some better tool on the GraalVM side to address this. Something like -H:ExcludeResources=... but let's say -H:IgnoreResources=... or something like that. To tell the app that it's O.K. these resources weren't found and that we don't care...?

WDYT?

@Karm Karm requested a review from zakkak December 17, 2024 15:12
@Karm Karm self-assigned this Dec 17, 2024
Copy link

quarkus-bot bot commented Dec 17, 2024

/cc @galderz (awt)

@Karm Karm changed the title ThrowMissingRegistrationErrors:Disables AWT Desktop i18N, disables SPI for ImageIO ThrowMissingRegistrationErrors: AWT Desktop i18N, SPI for ImageIO Dec 17, 2024
Copy link

quarkus-bot bot commented Dec 17, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 9f2ea84.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@Karm
Copy link
Member Author

Karm commented Dec 20, 2024

TODO:
I'll try to create and register an ImageIO plugin and see if that is not crippled by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The usage of the awt extension results in unregistered resource or reflective accesses in native mode
1 participant