Open athkalia opened 3 years ago
@athkalia could you provide an example that reproduces the problem?
@graemerocher I have the exact same problem in my pet-project: https://github.com/kuvasz-uptime/kuvasz
With a regular docker image there is no problem around declarative clients annotated with @Client
, however in this file the sendMessage
call always fails when I run the native image:
https://github.com/kuvasz-uptime/kuvasz/blob/2297709d97ee0d9ee61df17ab3b37b463fb56338/src/main/kotlin/com/kuvaszuptime/kuvasz/services/TelegramAPIService.kt
The weirdest part is that the HTTP request is successful (I get the messages on Telegram), but the retry logic kicks in and sends the request again and again, because of the following exception:
Caused by: io.micronaut.http.codec.CodecException: Error decoding stream for type [class io.reactivex.Single]: Cannot construct instance of `io.reactivex.Single` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
Also, there is a very similar approach here: https://github.com/kuvasz-uptime/kuvasz/blob/2297709d97ee0d9ee61df17ab3b37b463fb56338/src/main/kotlin/com/kuvaszuptime/kuvasz/services/SlackWebhookService.kt but this client call doesn't fail in a native image.
FYI I upgraded to RxJava 3 and everything worked
Expected Behavior
I am using an RxJava 2
io.reactivex.Single
type as return type of a Micronaut declarative HTTP client (with annotation@Client
). An example looks like this:(I do need to import the dependencies
io.micronaut.rxjava2:micronaut-rxjava2-http-client
andio.reactivex.rxjava2:rxjava
)This works fine, except when I am using the native GraalVM images. Then I get the following error
Actual Behaviour
I am wondering if as part of moving the RxJava 2 out of the platform, some reflection configuration for GraalVM was accidentally removed altogether or something?
Steps To Reproduce
No response
Environment Information
This is happening in AWS Lambda
Example Application
No response
Version
3.0.2