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

Jackson2ExecutionContextStringSerializer fails when deserializing java.time.LocalDate [BATCH-2838] #777

Closed
spring-issuemaster opened this issue Aug 27, 2019 · 3 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Aug 27, 2019

Benne Otten opened BATCH-2838 and commented

The ObjectMapper used in the Jackson2ExecutionContextStringSerializer doesn't register the JavaTimeModule. Because of this you cannot put java.time objects in the Execution Context.

I'd like to overrule the ObjectMapper used in the Jackson2ExecutionContextStringSerializer, and there's a setObjectMapper method for this very reason, but the objectmapper used in Jackson2ExecutionContextStringSerializer does register a JobParametersModule, which is a private inner class. This one does seem important, so overruling the used objectmapper seems a bad idea.

The simplest fix to this would be to register the JavaTimeModule in the Jackson2ExecutionContextStringSerializer, or to make the JobParametersModule public


Issue Links:

  • BATCH-2828 Allow for customisation of ObjectMapper in Jackson2ExecutionContextStringSerializer
    ("duplicates")
@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 27, 2019

Mahmoud Ben Hassine commented

Benne Otten I believe this is a duplicate of BATCH-2828, which would make it possible to provide a custom object mapper having the JavaTimeModule registered and augmented with the JobParametersModule. Do you confirm?

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Aug 29, 2019

Benne Otten commented

I agree. It is a different scenario, but it has the same resolution.

@spring-issuemaster
Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Sep 4, 2019

Mahmoud Ben Hassine commented

Resolved as duplicate of BATCH-2828.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.