Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support native compilation with graalvm #1652

Open
itineric opened this issue Oct 19, 2023 · 6 comments
Open

Support native compilation with graalvm #1652

itineric opened this issue Oct 19, 2023 · 6 comments
Labels

Comments

@itineric
Copy link

You could support graalvm native compilation.
Currently it is not working, some exception occur:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.zalando.logbook.json.JsonHttpLogFormatter$JsonBody and no properties discovered to create BeanSerializer

Detailed Description

Define reflect-config.json files as explained in graalvm documentation.

Context

Can use logbook when going native

@jordanorc
Copy link

jordanorc commented Oct 25, 2023

In my case I was able to solve the problem in a Spring Boot application adding the following content into the file: src/main/resources/META-INF/native-image/org.zalando/logbook/reflect-config.json:

[
    {
      "name" : "org.zalando.logbook.json.JsonHttpLogFormatter$JsonBody",
      "allPublicMethods" : true
    }
]

Thanks @itineric for the tip.

@itineric
Copy link
Author

you can do that with only one step:
rename your file reflection-config.json to reflect-config.json and place it inside src/main/resources/META-INF/native-image/<group id>/<artifact id> it will be picked up automatically.

It you are using Spring, you can also use ReflectionHints instead.

My point here is that this reflection config could be added directly to the logbook lib then no extra (external) configuration is required.

@jordanorc
Copy link

@itineric, thanks for the tip. I updated the answer. My goal was to help those who are facing same problem, while the solution is not added directly to the logbook.

@kasmarian
Copy link
Member

Looks like a nice addition to logbook. @itineric would you be interested in contributing to the library to add the necessary changes?

Copy link
Contributor

In order to prioritize the support for Logbook, we would like to check whether the old issues are still relevant.
This issue has not been updated for over six months.

  • Please check if it is still relevant in latest version of the Logbook.
  • If so, please add a descriptive comment to keep the issue open.
  • Otherwise, the issue will automatically be closed after a week.

@github-actions github-actions bot added the stale label Apr 29, 2024
@msdousti
Copy link
Collaborator

Could be something that we look into in the future. Let's not close the issue yet.

@github-actions github-actions bot removed the stale label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants