micronaut-guides
micronaut-guides copied to clipboard
Add `@ReflectiveAccess` to the fruit type in the mongodb guide
Expected Behavior
Receive a valid HTTP Response
Actual Behaviour
{"message":"Internal Server Error","_links":{"self":{"href":"/fruits","templated":false}},"_embedded":{"errors":[{"message":"Internal Server Error: Can't find a codec for class example.micronaut.Fruit."}]}}
Steps To Reproduce
- Go to https://guides.micronaut.io/latest/micronaut-mongodb-asynchronous-gradle-kotlin.html and dowload source code
- Create a docker container with docker (Optional, for local test); you can set the mongodb.uri parameter with your database connection string
- Generate a native file with GraalVM
- Run native binary
- Run
curl -i localhost:8080/fruits
following the example of the guide, you can also execute the POST, the error appears in both methods - You maybe receive a response like
{"message":"Internal Server Error","_links":{"self":{"href":"/fruits","templated":false}},"_embedded":{"errors":[{"message":"Internal Server Error: Can't find a codec for class example.micronaut.Fruit."}]}}
Environment Information
- Operating System: Ubuntu 22.04 LTS (It also happens in a kubernetes cluster)
- JDK Version: 11
- GraalVM: 22.0.0.2.r11-grl (recommended in the tutorial for java 11)
Example Application
https://guides.micronaut.io/latest/micronaut-mongodb-asynchronous-gradle-kotlin.html
Version
3.4.1