ypriverol
ypriverol

Reputation: 605

Error in Spring batch after job finish with Success

I'm running a Spring batch application with the following command:

java -jar application.jar  --spring.batch.job.names=nameJob param1=PXD002089 param2=51925

The job complete successfully:

  00:05:14.335 [main] INFO  o.s.b.c.l.support.SimpleJobLauncher - Job: [SimpleJob: [name=nameJob]] completed with the following parameters: [{param2=88210, param1=PXD009239, -spring.batch.job.names=nameJob}] and the following status: [COMPLETED]
  00:05:14.357 [main] INFO  o.s.b.a.l.ConditionEvaluationReportLoggingListener - 

However, after that, the tool throws an error and the exit code is 1:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
00:05:14.364 [main] ERROR o.s.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: Failed to execute CommandLineRunner
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800)
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:781)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
    at uk.ac.ebi.pride.archive.pipeline.ArchiveSubmissionPipeline.main(ArchiveSubmissionPipeline.java:10)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.NullPointerException: null
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.executeLocalJobs(JobLauncherCommandLineRunner.java:174)
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.launchJobFromProperties(JobLauncherCommandLineRunner.java:134)
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.run(JobLauncherCommandLineRunner.java:128)
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:797)
    ... 13 common frames omitted

I was having a llok to that class JobLauncherCommandLineRunner.java:174 and Spring is trying to read the next job?

Any idea?

Upvotes: 0

Views: 699

Answers (1)

biafreire2611
biafreire2611

Reputation: 51

I suggest starting the investigation by the cause:

"Caused by: java.lang.NullPointerException: null".

Maybe the solution can be simple.

Upvotes: 1

Related Questions