Uploaded image for project: 'Spring Batch Admin'
  1. Spring Batch Admin
  2. BATCHADM-224

/batch/executions.json throws a NullPointerException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Manager
    • Labels:
      None

      Description

      On Spring Batch Admin 2.0.0-M1, a GET to http://localhost:8080/batch/executions.json returns a NullPointerException message :

      [
          "java.util.ArrayList",
          [
              {
                  "@class": "org.springframework.hateoas.VndErrors$VndError",
                  "logref": "NullPointerException",
                  "message": "NullPointerException",
                  "links": [
                      "java.util.ArrayList",
                      []
                  ]
              }
          ]
      ]
      

      Here is the stacktrace:

      21:14:36.215 [ERROR] [qtp346861221-16] [] o.s.b.admin.web.RestControllerAdvice - Caught exception while handling a request
      java.lang.NullPointerException: null
      	at org.springframework.batch.admin.domain.JobExecutionInfoResource.<init>(JobExecutionInfoResource.java:146) ~[spring-batch-admin-domain-2.0.0.M1.jar:na]
      	at org.springframework.batch.admin.web.resource.JobExecutionInfoResourceAssembler.instantiateResource(JobExecutionInfoResourceAssembler.java:63) ~[spring-batch-admin-manager-2.0.0.M1.jar:na]
      	at org.springframework.batch.admin.web.resource.JobExecutionInfoResourceAssembler.instantiateResource(JobExecutionInfoResourceAssembler.java:36) ~[spring-batch-admin-manager-2.0.0.M1.jar:na]
      	at org.springframework.hateoas.mvc.ResourceAssemblerSupport.createResourceWithId(ResourceAssemblerSupport.java:89) ~[spring-hateoas-0.16.0.RELEASE.jar:na]
      	at org.springframework.hateoas.mvc.ResourceAssemblerSupport.createResourceWithId(ResourceAssemblerSupport.java:81) ~[spring-hateoas-0.16.0.RELEASE.jar:na]
      	at org.springframework.batch.admin.web.resource.JobExecutionInfoResourceAssembler.toResource(JobExecutionInfoResourceAssembler.java:48) ~[spring-batch-admin-manager-2.0.0.M1.jar:na]
      	at org.springframework.batch.admin.web.BatchJobExecutionsController.getJobExecutionInfoResource(BatchJobExecutionsController.java:208) ~[spring-batch-admin-manager-2.0.0.M1.jar:na]
      

      As you can seen on the nullpointerexception.jpg screenshot, the jobExecution.getEndTime() is null for a jobExecution in an UNKNOWN status.

        Attachments

          Activity

            People

            Assignee:
            mminella Michael Minella
            Reporter:
            elryk Elryk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: