Created
April 24, 2021 09:42
-
-
Save anentropic/ba2f95dcecabe789bd8c7d414f0f0302 to your computer and use it in GitHub Desktop.
GraalVM native-image reflection config for Log4J
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name" : "org.apache.log4j.Category", | |
"allDeclaredConstructors" : true, | |
"allPublicConstructors" : true, | |
"allDeclaredMethods" : true, | |
"allPublicMethods" : true, | |
"allDeclaredClasses" : true, | |
"allPublicClasses" : true | |
}, | |
{ | |
"name" : "org.apache.log4j.CategoryKey", | |
"allDeclaredConstructors" : true, | |
"allPublicConstructors" : true, | |
"allDeclaredMethods" : true, | |
"allPublicMethods" : true, | |
"allDeclaredClasses" : true, | |
"allPublicClasses" : true | |
}, | |
{ | |
"name" : "org.apache.log4j.Logger", | |
"allDeclaredConstructors" : true, | |
"allPublicConstructors" : true, | |
"allDeclaredMethods" : true, | |
"allPublicMethods" : true, | |
"allDeclaredClasses" : true, | |
"allPublicClasses" : true | |
}, | |
{ | |
"name" : "org.apache.log4j.helpers.Loader", | |
"allDeclaredConstructors" : true, | |
"allPublicConstructors" : true, | |
"allDeclaredMethods" : true, | |
"allPublicMethods" : true, | |
"allDeclaredClasses" : true, | |
"allPublicClasses" : true | |
}, | |
{ | |
"name" : "java.lang.Thread", | |
"allDeclaredConstructors" : true, | |
"allPublicConstructors" : true, | |
"allDeclaredMethods" : true, | |
"allPublicMethods" : true, | |
"allDeclaredClasses" : true, | |
"allPublicClasses" : true | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Graal provides a lot of control here over exactly what reflection features are analysed. So I guess this stuff must slow down the compilation and/or the executable and/or bloat the size of the artefact. (otherwise why not turn it on for everything?)
Here I have just enabled maximum reflection for each of the problem classes I encountered.
Probably some time I could go through and try to narrow these down to the minimum... mostly I'm just glad it's working now.