You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference-manual/native-image/ReachabilityMetadata.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -468,14 +468,14 @@ The Native Image agent does not support custom implementations of `ResourceBundl
468
468
469
469
This mode will be made the default behavior of Native Image in a future release. We encourage you to start transitioning your code as soon as possible.
470
470
The [Native Image agent](AutomaticMetadataCollection.md) outputs JSON files that conform to both the default and strict modes of operation.
471
-
The following options are useful for debugging issues during the transition to the strict mode:
472
-
473
-
* `-H:ThrowMissingRegistrationErrors=<package list>`: limits `MissingReflectionRegistrationError` to be thrown from a defined list of packages.
474
-
This is useful when using some library code that has not been ported to the new mode yet;
475
-
* `-H:MissingRegistrationReportingMode`: sets how `MissingReflectionRegistrationError` is reported:
476
-
* `Throw` is the default. The error is simply thrown as a Java exception;
477
-
* `Warn` outputs a small stack trace for every error encountered, which results in a report of all the places the tested code is going to throw when the strict mode is enabled;
478
-
* `Exit` exits the program when encountering the error. This is useful to detect blanket `catch (Throwable t) {` blocks that would otherwise silence the error.
471
+
Native Image also provides some useful options for debugging issues during the transition to the strict mode:
472
+
473
+
* To make sure that the reflection for your image is configured correctly you can add `-H:ThrowMissingRegistrationErrors=` to the native-image build arguments.
474
+
If the resulting image fails in libraries that are not under your control, you can add a package prefix to the option to limit the errors to operations called from classes within the specified packages: `-H:ThrowMissingRegistrationErrors=<package-prefix>`.
475
+
* The default behavior under `-H:ThrowMissingRegistrationErrors=` is to throw an error, which will potentially end the program execution.
476
+
To get an overview of all places in your code where missing registrations occur, including a small stack trace, without committing to the strict behavior you can add `-XX:MissingRegistrationReportingMode=Warn` to the program invocation.
477
+
To detect places where the application accidentally swallows a missing registration error (such as with blanket `catch (Throwable t)` blocks), you can add `-XX:MissingRegistrationReportingMode=Exit` to the program invocation.
478
+
The application will then unconditionally print the error message and stack trace and exit immediately without throwing.
Copy file name to clipboardExpand all lines: substratevm/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ This changelog summarizes major changes to GraalVM Native Image.
13
13
* (GR-47712) Using the `--static` option without the `--libc=musl` option causes the build process to fail (and reports the appropriate error). Static linking is currently only supported with musl.
14
14
* (GR-50434) Introduce a `"type"` field in reflection and JNI configuration files to support more than simple named types.
15
15
* (GR-51053) Use [`vswhere`](https://github.com/microsoft/vswhere) to find Visual Studio installations more reliably and in non-standard installation locations.
16
+
* (GR-52314) `-XX:MissingRegistrationReportingMode` can now be used on program invocation instead of as a build option, to avoid a rebuild when debugging missing registration errors.
16
17
17
18
## GraalVM for JDK 22 (Internal Version 24.0.0)
18
19
* (GR-48304) Red Hat added support for the JFR event ThreadAllocationStatistics.
if (seenOutputs.get() == null && seenOutputs.compareAndSet(null, ConcurrentHashMap.newKeySet())) {
97
96
/* First output, we print an explanation message */
98
97
System.out.println("Note: this run will print partial stack traces of the locations where a " + exception.getClass().toString() + " would be thrown " +
99
98
"when the -H:+ThrowMissingRegistrationErrors option is set. The trace stops at the first entry of JDK code and provides " + CONTEXT_LINES + " lines of context.");
0 commit comments