spring batch null job runner null指针异常

时间:2013-02-09 08:47:14

标签: nullpointerexception jobs spring-batch runner

您好我在执行示例弹出批处理作业时遇到空指针异常。从工作启动器抛出异常。这是我的工作启动码。提前谢谢。

public class NewJobRunner {
public static Job job;
public static JobLauncher jobLauncher;
public static JobRepository jobRepository;

public static void main(String args[]) {
    try {
        AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext("/resources/job-context.xml");
        jobLauncher.run(job, new JobParametersBuilder()
                    .toJobParameters()
        );
    }catch(Exception e) {
        e.printStackTrace();
    }

}

public void setJobLauncher(JobLauncher jobLauncher) {
    this.jobLauncher = jobLauncher;
}

public void setJobRepository(JobRepository jobRepository) {
    this.jobRepository = jobRepository;
}

public void setJob(Job job) {
    this.job = job;
}

0 个答案:

没有答案