Project: springxd
Issue XD-1206: Garbage in Job Repo Causes List Failure
For some reason, the partitioned batch jobs are storing {{StepExecutions}}s in the DB with a null ID. This causes {{JobCommandTests.testListStepExecutionsForSpecificJobExecution()}} to fail because the HATEOS code asserts not null... {code} 18:25:26,185 ERROR http-nio-9393-exec-3 rest.RestControllerAdvice:186 - Caught exception while handling a request java.lang.IllegalArgumentException: [Assertion failed] - this argument is required; it must not be null org.springframework.util.Assert.notNull(Assert.java:112) org.springframework.util.Assert.notNull(Assert.java:123) org.springframework.hateoas.mvc.ResourceAssemblerSupport.createResourceWithId(ResourceAssemblerSupport.java:87) org.springframework.xd.dirt.rest.StepExecutionInfoResourceAssembler.toResource(StepExecutionInfoResourceAssembler.java:39) org.springframework.xd.dirt.rest.BatchStepExecutionsController.list(BatchStepExecutionsController.java:107) {code} For some reason, the query for objects with the {{jobExecutionId}} also returned these two objects with null keys. Blowing away my data directory fixes the problem (until I run another partitioned batch job). I need to figure out why spring batch is creating these bad records, but we should probably add some defensive code to protect against null IDs. You can reproduce by building against my XD-1146 branch.
Story points: 1