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
com.fasterxml.jackson.databind.JsonMappingException: Class CustomSerializer has no default (no arg) constructor #12345
Comments
Hi, How do you register your serializer with Jackson? |
Hi, in the entity bean like this |
We have some code to deal with that but apparently we're missing something. Could you prepare a small reproducer so that we can have a look? Thanks! |
Here is my reproducer project, can checkout it? https://github.com/banifou/jdbc-jackson-serialiser |
Fix reflection registration issue with Jackson's @JsonSerialize
Hi, I still got this problem when running the GraalVM generated native image:
Code:
Environment info:
|
@zipper01 any chance you can attach a sample application we can try? |
@geoand please see here: running output with exception info: |
This is a reproducer for quarkusio/quarkus#12345 (comment)
What you added does not appear to be a Quarkus project |
@geoand sorry it's not a Quarkus project (at the moment). I am trying to use GraalVM to generate the native image. When googling for the exception I came across this ticket it looks highly matches my case - same exception from the same library. |
Quarkus does extra work to make things like that happen - if you don't use Quarkus, you need to configure GraalVM yourself. |
Ok, thank you. |
🙏🏼 |
Describe the bug
I'm using a custom serialiser extending
com.fasterxml.jackson.databind.ser.std.StdSerializer
to serve a REST Api. It works fine in OpenJDK 11. When I run it in native mode, I get a no default (no arg) constructor error.Expected behavior
Get my java object serialized serving/producing an
application/json
endpoint.Actual behavior
When i try to get the serialized entity object retrieved from Postgresql with the native image (in GET) it does throw error
Note that the class actually does have a no-arg constructor:
Environment (please complete the following information):
Ubuntu 20.04.1 LTS. Graalvm-ce-java11-linux-amd64-20.2.0. Quarkus 1.8.1
The text was updated successfully, but these errors were encountered: