graal support?
See original GitHub issueI use jjwt generate token for my micronaut app,I use graalvm build native-image, when generate token, I get this error:
io.jsonwebtoken.lang.UnknownClassException: Unable to load class named [io.jsonwebtoken.impl.DefaultJwtBuilder] from the thread context, current, or system/application ClassLoaders. All heuristics have been exhausted. Class could not be found. Have you remembered to include the jjwt-impl.jar in your runtime classpath?
I already setting jjwt-impl.jar in build.gradle, but because of native-image has limitation with reflection, so dynamic class loading can not work, I follow the graal manual add reflection-config.json in META-INF and its working!
[ { "name" : "io.jsonwebtoken.impl.DefaultJwtBuilder", "allDeclaredFields" : true, "allPublicMethods" : true, "allDeclaredConstructors" : true } ]
so can we just put the graal config in jjwt-impl.jar to support graal native-image?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:12 (6 by maintainers)
Top GitHub Comments
A
CompressionCodecResolver
is always needed in case azip
header is encountered, but I understand your point around reflection.We have discussed at times moving the
impl
package and its sub-packages into a single .jar and changing everything in there to package protected to prevent people from depending on those classes, but there needs to be some significant analysis to ensure nothing can ‘leak’ unexpectedly. It’ll be a decent amount of work.A
reflect-config.json
might be a better/faster stop-gap in the meantime however.