Skip to content

Cannot run job with LocalDate(Time) job parameters #4257

Closed
@winfr34k

Description

@winfr34k

I didn't find any obvious duplicate but maybe I'm also misunderstanding the scopes of the Spring Batch project, so maybe this "bug" is really as designed.

Bug description

If a job is run with LocalDate or LocalDateTime job parameters, the run fails because the execution cannot be persisted.
An exception like "No converter found capable of converting from type [java.time.LocalDate] to type [java.lang.String]" is thrown.

Environment

  • Spring Boot 3.0.0
  • Spring Batch 5.0.0
  • H2 Database 2.1.214
  • OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8)
  • macOS 13.0.1

Steps to reproduce

  1. Prepare JobParameters using the JobParametersBuilder with either LocalDate or LocalDateTime instances.
  2. Run any job with the aforementioned job parameters

Expected behavior

Since the builder offers convenience methods, I would expect the job execution to just complete with either of them.

Minimal Complete Reproducible example

https://gitlab.com/winfr34k/spring-batch-localdate-reproducer

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions