2017-05-08 206 views
-2

我有彈簧引導和彈簧批量項目。運行該項目時,我得到這個例外 我使用Spring Batch的IndexOutOfBoundsException彈簧批量和彈簧啓動

<dependency> 
    <groupId>org.springframework.batch</groupId> 
    <artifactId>spring-batch-core</artifactId> 
    <version>3.0.7.RELEASE</version> 
</dependency> 

春季啓動1.3.5 :

2017-05-08 19:33:28.363 DEBUG 23790 --- [   main] o.s.w.c.s.StandardServletEnvironment  : Adding [server.ports] PropertySource with highest search precedence 
2017-05-08 19:33:28.372 INFO 23790 --- [   main] o.s.b.a.b.JobLauncherCommandLineRunner : Running default command line with: [--debug, --spring.output.ansi.enabled=always] 
2017-05-08 19:33:28.399 ERROR 23790 --- [   main] o.s.boot.SpringApplication    : Application startup failed 

java.lang.IllegalStateException: Failed to execute CommandLineRunner 
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:809) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:790) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:777) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:308) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at com.sellware.module.ebay.Application.main(Application.java:52) [classes/:na] 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121] 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121] 
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121] 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) [idea_rt.jar:na] 
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 
    at java.util.ArrayList.rangeCheck(ArrayList.java:653) ~[na:1.8.0_121] 
    at java.util.ArrayList.get(ArrayList.java:429) ~[na:1.8.0_121] 
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.getNextJobParameters(JobLauncherCommandLineRunner.java:145) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.execute(JobLauncherCommandLineRunner.java:214) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.executeLocalJobs(JobLauncherCommandLineRunner.java:233) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.launchJobFromProperties(JobLauncherCommandLineRunner.java:125) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.autoconfigure.batch.JobLauncherCommandLineRunner.run(JobLauncherCommandLineRunner.java:119) ~[spring-boot-autoconfigure-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:806) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE] 
    ... 11 common frames omitted 

回答

2

解決了排除BatchAutoConfiguration

@SpringBootApplication(exclude = BatchAutoConfiguration.class)