spring-projects / spring-projects/spring-batch

better exception message for step with commit-interval null [BATCH-2518]

Open
#1,084 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

Michael Pralow opened BATCH-2518 and commented

if you use a standard chunk processing step with parameterized commit-interval like

<batch:tasklet>
  <batch:chunk reader="reader" processor="processor" writer="writer" commit-interval="#{jobParameters['commitInterval']}">
  </batch:chunk>
</batch:tasklet>

and forget to provide the job parameter, thus getting a null there (i guess it is null), the exception is

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.org.springframework.batch.repeat.policy.SimpleCompletionPolicy#0': Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)

it would be cool to get a better hint for the real cause here


Affects: 3.0.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the XML chunk configuration with a parameterized commit-interval and no matching job parameter. Trace the bean creation path that produces the SimpleCompletionPolicy constructor error. Done means the exception gives a useful hint about the missing or null commit interval.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.