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

@JsonNaming strategy is not supported in GraalVM native image #29386

Closed
sarathchand09 opened this issue Oct 26, 2022 · 6 comments
Closed

@JsonNaming strategy is not supported in GraalVM native image #29386

sarathchand09 opened this issue Oct 26, 2022 · 6 comments
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@sarathchand09
Copy link

sarathchand09 commented Oct 26, 2022

Overview

I am using Spring Boot 3.0 RC1 and GraalVM latest.

My native image works fine.

@JsonNaming(PropertyNamingStrategies.UpperSnakeCaseStrategy.class)

Using the above annotation for upper case JSON field names works fine with jar,
but it doesn't work when running in the native image.

I am also using Lombok @Data on my POJO.

2022-10-26T14:42:15.875+02:00 WARN 1 --- [nio-8080-exec-4] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Error creating bean with name 'com.fasterxml.jackson.databind.PropertyNamingStrategies$UpperSnakeCaseStrategy': Failed to instantiate [com.fasterxml.jackson.databind.PropertyNamingStrategies$UpperSnakeCaseStrategy]: No default constructor found] |

Related Issues

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 26, 2022
@sbrannen sbrannen added the theme: aot An issue related to Ahead-of-time processing label Oct 26, 2022
@sbrannen
Copy link
Member

What happens if you manually add GraalVM native image reflection configuration for com.fasterxml.jackson.databind.PropertyNamingStrategies.UpperSnakeCaseStrategy?

@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Oct 26, 2022
@sbrannen sbrannen changed the title spring 3 / graalvm native image / error while converting field upper case jsonnames spring rest @JsonNaming strategy not supported in GraalVM native image Oct 26, 2022
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Nov 2, 2022
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 9, 2022
@snicoll
Copy link
Member

snicoll commented Nov 9, 2022

Note that we had a similar report in Spring Boot and we've just pushed something that would contribute those hints, see spring-projects/spring-boot#33080

@sbrannen

This comment was marked as duplicate.

@sbrannen sbrannen changed the title @JsonNaming strategy not supported in GraalVM native image @JsonNaming strategy is not supported in GraalVM native image Dec 6, 2022
@sbrannen sbrannen added the type: enhancement A general enhancement label Dec 6, 2022
@sdeleuze sdeleuze self-assigned this Jan 20, 2023
@sdeleuze sdeleuze added this to the 6.0.5 milestone Jan 20, 2023
@sdeleuze sdeleuze reopened this Jan 20, 2023
@sdeleuze
Copy link
Contributor

Should be handled by #29646 fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants