Closed preslavrachev closed 6 months ago
Hi @preslavrachev, thanks for raising this issue.
Decompression seems to be working fine when tested in a simple native image built with the GraalVM Gradle plugin. However, I'm yet to try it with Quarkus, which might be doing something differently. BTW the class you're looking for is GzipBodyDecoderFactory
, does it help adding it in reflection-config.json
?
It'd be good to make the claim that Methanol is automatically compatible with GraalVM, so I'll make sure to run tests in a GraalVM image as part of CI and make the necessary changes before the next release.
@mizosoft - thanks, yeah, I discovered the factory a bit later. I haven't yet tried adding it instead, but I will check it early next week. In case you manage to get some positive results with Quarkus, I'd be happy to add Methanol on board, because it is a real time-saver.
@preslavrachev sure, I'll let you know when I give it a try. Glad Methanol could be helpful!
I use methanol in a Quarkus app built as native image and it works fine. Perhaps this is a config issue. Did you set quarkus.http.enable-decompression=true
in the application properties?
https://quarkus.io/guides/all-config#quarkus-vertx-http_quarkus.http.enable-decompression
Apologies for not getting back to this sooner :)
For quarkus, you have to explicitly tell it to allow ServiceLoader
usage in the native image. Check out this for how.
For plain GraalVM, it automatically picks up the META-INF/services
files, so the mechanism works implicitly.
Methanol runs perfectly fine in a JVM app, but produces the following exception when running inside a native image binary:
My assumption is that this is due to runtime class loading and reflection at play. I tried listing the class
GzipDecoder
as part of the standard GraalVMreflection-config.json
, but it did not seem to help.NOTE: My app is based on Quarkus
Would you have any idea how to solve that? Is there a way to register the decoder manually?