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-projects-issues opened this issue Aug 27, 2019 · 3 comments
Labels
status: duplicate Issues that are duplicates of other issues type: bug

Comments

@spring-projects-issues
Copy link
Collaborator

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-projects-issues
Copy link
Collaborator Author

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-projects-issues
Copy link
Collaborator Author

Benne Otten commented

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

@spring-projects-issues
Copy link
Collaborator Author

Mahmoud Ben Hassine commented

Resolved as duplicate of BATCH-2828.

@spring-projects-issues spring-projects-issues added type: bug status: duplicate Issues that are duplicates of other issues labels Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate Issues that are duplicates of other issues type: bug
Projects
None yet
Development

No branches or pull requests

1 participant