java.lang.NullPointerException: null

Spring JIRA | Elryk | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    On Spring Batch Admin 2.0.0-M1, a GET to http://localhost:8080/batch/executions.json returns a NullPointerException message : {code:json} [ "java.util.ArrayList", [ { "@class": "org.springframework.hateoas.VndErrors$VndError", "logref": "NullPointerException", "message": "NullPointerException", "links": [ "java.util.ArrayList", [] ] } ] ] {code} Here is the stacktrace: {code:java} 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] {code} As you can seen on the nullpointerexception.jpg screenshot, the jobExecution.getEndTime() is null for a jobExecution in an UNKNOWN status.

    Spring JIRA | 2 years ago | Elryk
    java.lang.NullPointerException: null
  2. 0

    On Spring Batch Admin 2.0.0-M1, a GET to http://localhost:8080/batch/executions.json returns a NullPointerException message : {code:json} [ "java.util.ArrayList", [ { "@class": "org.springframework.hateoas.VndErrors$VndError", "logref": "NullPointerException", "message": "NullPointerException", "links": [ "java.util.ArrayList", [] ] } ] ] {code} Here is the stacktrace: {code:java} 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] {code} As you can seen on the nullpointerexception.jpg screenshot, the jobExecution.getEndTime() is null for a jobExecution in an UNKNOWN status.

    Spring JIRA | 2 years ago | Elryk
    java.lang.NullPointerException: null

    Root Cause Analysis

    1. java.lang.NullPointerException

      null

      at org.springframework.batch.admin.domain.JobExecutionInfoResource.<init>()
    2. org.springframework.batch
      JobExecutionInfoResourceAssembler.instantiateResource
      1. org.springframework.batch.admin.domain.JobExecutionInfoResource.<init>(JobExecutionInfoResource.java:146)[spring-batch-admin-domain-2.0.0.M1.jar:na]
      2. org.springframework.batch.admin.web.resource.JobExecutionInfoResourceAssembler.instantiateResource(JobExecutionInfoResourceAssembler.java:63)[spring-batch-admin-manager-2.0.0.M1.jar:na]
      3. org.springframework.batch.admin.web.resource.JobExecutionInfoResourceAssembler.instantiateResource(JobExecutionInfoResourceAssembler.java:36)[spring-batch-admin-manager-2.0.0.M1.jar:na]
      3 frames
    3. Spring Hateoas
      ResourceAssemblerSupport.createResourceWithId
      1. org.springframework.hateoas.mvc.ResourceAssemblerSupport.createResourceWithId(ResourceAssemblerSupport.java:89)[spring-hateoas-0.16.0.RELEASE.jar:na]
      2. org.springframework.hateoas.mvc.ResourceAssemblerSupport.createResourceWithId(ResourceAssemblerSupport.java:81)[spring-hateoas-0.16.0.RELEASE.jar:na]
      2 frames
    4. org.springframework.batch
      BatchJobExecutionsController.getJobExecutionInfoResource
      1. org.springframework.batch.admin.web.resource.JobExecutionInfoResourceAssembler.toResource(JobExecutionInfoResourceAssembler.java:48)[spring-batch-admin-manager-2.0.0.M1.jar:na]
      2. org.springframework.batch.admin.web.BatchJobExecutionsController.getJobExecutionInfoResource(BatchJobExecutionsController.java:208)[spring-batch-admin-manager-2.0.0.M1.jar:na]
      2 frames