Commit 92e9115
committed
Reproduce
This change reproduces the issue described in apache/logging-log4j2#3871, where configurations that include `ThresholdFilter` (or any other Log4j filter) fail to work correctly when building a GraalVM native image.
The root cause is a mismatch in how parameter types are represented in `reflect-config.json`:
* The existing metadata stores parameter types using their canonical class name (JLS §6.7).
* However, GraalVM expects the binary class name (JLS §13.1).
This is especially relevant for nested types:
* Canonical name: `org.apache.logging.log4j.core.Filter.Result`
* Binary name: `org.apache.logging.log4j.core.Filter$Result`
* For array types, GraalVM accepts either:
* the JVM descriptor form (`[L<component_type>;`), or
* the Java-like form (`<component_type>[]`).
This PR introduces tests that intentionally fail for the `log4j-core` and `log4j-core-jtl` profiles, because they rely on the embedded reachability metadata in Log4j Core, which currently uses canonical names.
In contrast, the `log4j-core-minimal` and `log4j-core-jtl-minimal` profiles rely on manually generated metadata, which has been updated in this PR to use the expected binary names and now works correctly under GraalVM.ThresholdFilter GraalVM issue1 parent 9d77f55 commit 92e9115
File tree
10 files changed
+66
-4
lines changed- log4j-samples-graalvm/src
- main/resources
- reachability-metadata
- log4j-core-jtl-minimal
- resources/META-INF
- native-image/org.apache.logging.log4j/log4j-core
- org/apache/logging/log4j/core/config/plugins
- log4j-core-minimal
- resources/META-INF
- native-image/org.apache.logging.log4j/log4j-core
- org/apache/logging/log4j/core/config/plugins
- test/java/org/apache/logging/log4j/samples/graalvm
10 files changed
+66
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
628 | 628 | | |
629 | 629 | | |
630 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
631 | 645 | | |
632 | | - | |
| 646 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
509 | 518 | | |
510 | 519 | | |
511 | 520 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1319 | 1333 | | |
1320 | | - | |
| 1334 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments