Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve error message when neither commit-interval nor chunk-completion-policy are specified on a chuck (xml namespace) [BATCH-1202] #2377
When neither commit-interval nor chunk-completion-policy are specified on a chuck element, the following error message is output:
Configuration problem: The <chunk/> element must contain either 'commit-interval' or 'chunk-completion-policy', but not both.
The problem is in ChunkElementParser.java, lines 100, 101. The test propertyValues.contains("commitInterval") == propertyValues.contains("chunkCompletionPolicy") returns true if both elements are present or absent.
It would be nicer to distinguish between these 2 cases.
Referenced from: commits 5d303c6
Don Hamson commented
While I do get this error, a better report would also tell the id of the chunk/tasklet in error. Depending upon how many steps, we could be poking at things for a while before finding the offending object.
Dave Syer commented
A chunk or tasklet has no ID so that won't work. If you're using Spring IDE there is a margin marker on the offending line of XML. Beyond that you would need to raise an issue in JIRA for Spring IDE and/or Spring Core to get the line number to come out in stack traces. I'm sure it's doable: just not by us.