title: Spring Batch - the batch works in Eclipse but not as a JAR - without explicit DEBUG log
body: <p>I am new to Spring. My batch works in Eclipse using Spring Boot. </p>
  
  <pre><code>        public class Main {
        public static void main(String [] args) {
            System.exit(SpringApplication.exit(SpringApplication.run(BatchConfiguration.class, args)));
        }
      }
  </code></pre>
  
  <p>Here are the Eclipse's logs.</p>
  
  <pre><code>          .   ____          _            __ _ _
       /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
      ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
       \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
        '  |____| .__|_| |_|_| |_\__, | / / / /
       =========|_|==============|___/=/_/_/_/
       :: Spring Boot ::        (v1.1.4.RELEASE)
  
      2014-08-08 12:01:09.714  INFO 292 --- [           main] f.i.a.fczeuj.springbatch.Main            : Starting Main on W100023928 with PID 292 (started by Me in D:\Eclipse_workspace\SpringBatchJavaConfig)
      2014-08-08 12:01:09.776  INFO 292 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@714ae2c1: startup date [Fri Aug 08 12:01:09 CEST 2014]; root of context hierarchy
      2014-08-08 12:01:10.494  INFO 292 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'org.springframework.boot.autoconfigure.AutoConfigurationPackages': replacing [Generic bean: class [org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] with [Generic bean: class [org.springframework.boot.autoconfigure.AutoConfigurationPackages$BasePackages]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]
      2014-08-08 12:01:10.979  WARN 292 --- [           main] o.s.c.a.ConfigurationClassEnhancer       : @Bean method ScopeConfiguration.stepScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean Javadoc for complete details
      2014-08-08 12:01:10.994  WARN 292 --- [           main] o.s.c.a.ConfigurationClassEnhancer       : @Bean method ScopeConfiguration.jobScope is non-static and returns an object assignable to Spring's BeanFactoryPostProcessor interface. This will result in a failure to process annotations such as @Autowired, @Resource and @PostConstruct within the method's declaring @Configuration class. Add the 'static' modifier to this method to avoid these container lifecycle issues; see @Bean Javadoc for complete details
      2014-08-08 12:01:11.166  INFO 292 --- [           main] o.s.j.d.DriverManagerDataSource          : Loaded JDBC driver: org.postgresql.Driver
      sql=insert into schema_batch_01.table_batch_donnees_massives values (:num_ligne,(((extract('epoch' from statement_timestamp())*1000)::bigint)-1407492071384)/1000,:prenom, :nom, :rue, :ville, :etat)
      2014-08-08 12:01:11.618  INFO 292 --- [           main] o.s.jdbc.datasource.init.ScriptUtils     : Executing SQL script from class path resource [org/springframework/batch/core/schema-postgresql.sql]
      2014-08-08 12:01:11.619  INFO 292 --- [           main] o.s.jdbc.datasource.init.ScriptUtils     : Executed SQL script from class path resource [org/springframework/batch/core/schema-postgresql.sql] in 1 ms.
      2014-08-08 12:01:11.822  INFO 292 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
      2014-08-08 12:01:11.838  INFO 292 --- [           main] o.s.b.a.b.JobLauncherCommandLineRunner   : Running default command line with: []
      2014-08-08 12:01:11.884  INFO 292 --- [           main] o.s.b.c.r.s.JobRepositoryFactoryBean     : No database type set, using meta data indicating: POSTGRES
      2014-08-08 12:01:12.025  INFO 292 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : No TaskExecutor has been set, defaulting to synchronous executor.
      2014-08-08 12:01:12.493  INFO 292 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [SimpleJob: [name=job1]] launched with the following parameters: [{run.id=28}]
      2014-08-08 12:01:12.664  INFO 292 --- [           main] o.s.batch.core.job.SimpleStepHandler     : Executing step: [taskletTruncate]
      truncateDonnees DataSource=
      org.springframework.jdbc.datasource.DriverManagerDataSource@7e913c56
      Username=
      role_cnx_batch_seminaire_dev
      2014-08-08 12:01:13.102  INFO 292 --- [           main] o.s.batch.core.job.SimpleStepHandler     : Executing step: [stepInserts]
      2014-08-08 12:01:18.079  INFO 292 --- [           main] o.s.b.c.l.support.SimpleJobLauncher      : Job: [SimpleJob: [name=job1]] completed with the following parameters: [{run.id=28}] and the following status: [COMPLETED]
      2014-08-08 12:01:18.079  INFO 292 --- [           main] f.i.a.fczeuj.springbatch.Main            : Started Main in 8.677 seconds (JVM running for 9.239)
      2014-08-08 12:01:18.079  INFO 292 --- [           main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@714ae2c1: startup date [Fri Aug 08 12:01:09 CEST 2014]; root of context hierarchy
      2014-08-08 12:01:18.079  INFO 292 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
  </code></pre>
  
  <p>So I have built a JAR with maven dependencies and main class in the MANIFEST and run the JAR <br>
  <code>java -jar myArchive.jar</code> <br>
  But the JAR does nothing, without ERRORS in the DOS logs.</p>
  
  <pre><code>        2014-08-08 12:10:47.125 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'batchConfiguration'
      sql=insert into schema_batch_01.table_batch_donnees_massives values (:num_ligne,(((extract('epoch' from statement_timestamp())*1000)::bigint)-1407492647125)/1000,:prenom, :nom
      , :rue, :ville, :etat)
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Eagerly caching bean 'writer' to allow for resolving potential circular refere
      nces
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Invoking afterPropertiesSet() on bean with name 'writer'
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Finished creating instance of bean 'writer'
      2014-08-08 12:10:47.141 DEBUG   --- [           main] s.c.a.AnnotationConfigApplicationContext : Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using defa
      ult [org.springframework.context.support.DefaultLifecycleProcessor@4dc1c92b]
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'lifecycleProcessor'
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'spring.liveBeansView.mbeanDomain' in [systemProperties]
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'spring.liveBeansView.mbeanDomain' in [systemEnvironment]
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.c.e.PropertySourcesPropertyResolver  : Searching for key 'spring.liveBeansView.mbeanDomain' in [class path resource [
      spring.batch.context.properties]]
      2014-08-08 12:10:47.141 DEBUG   --- [           main] o.s.c.e.PropertySourcesPropertyResolver  : Could not find key 'spring.liveBeansView.mbeanDomain' in any property source.
      Returning [null]
      2014-08-08 12:10:47.157  INFO   --- [           main] f.i.a.fczeuj.springbatch.Main            : Started Main in 0.952 seconds (JVM running for 1.264)
      2014-08-08 12:10:47.157  INFO   --- [           main] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationCont
      ext@356f144c: startup date [Fri Aug 08 12:10:46 CEST 2014]; root of context hierarchy
      2014-08-08 12:10:47.157 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'lifecycleProcessor'
      2014-08-08 12:10:47.157 DEBUG   --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Destroying singletons in org.springframework.beans.factory.support.DefaultList
      ableBeanFactory@11e7c5cb: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowi
      redAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,batc
      hConfiguration,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor,org.springframework.context.annotation.ConfigurationClassPostProcess
      or.enhancedConfigurationProcessor,org.springframework.batch.core.configuration.annotation.ScopeConfiguration,stepScope,jobScope,org.springframework.batch.core.configuration.an
      notation.SimpleBatchConfiguration,jobRepository,jobLauncher,jobRegistry,jobExplorer,transactionManager,jobBuilders,stepBuilders,fr.insee.architecture.fczeuj.springbatch.Contex
      tWithProperties,dataSource,nbIteration,org.springframework.boot.autoconfigure.AutoConfigurationPackages,taskletTruncate,reader,processor,writer,job,stepInserts]; root of facto
      ry hierarchy
      2014-08-08 12:10:47.157 DEBUG   --- [           main] o.s.b.f.support.DisposableBeanAdapter    : Invoking destroy() on bean with name 'batchConfiguration'
      2014-08-08 12:10:47.157 DEBUG   --- [           main] o.s.b.f.support.DisposableBeanAdapter    : Invoking destroy() on bean with name 'org.springframework.batch.core.configura
      tion.annotation.SimpleBatchConfiguration'
      2014-08-08 12:10:47.157 DEBUG   --- [           main] o.s.b.f.support.DisposableBeanAdapter    : Invoking destroy() on bean with name 'fr.architecture.springbatch
      .ContextWithProperties'
      2014-08-08 12:10:47.157 DEBUG   --- [           main] o.s.b.f.support.DisposableBeanAdapter    : Invoking destroy() on bean with name 'org.springframework.batch.core.configura
      tion.annotation.ScopeConfiguration'
  </code></pre>
  
  <p><br> the missing logs between the JAR and Eclipse is just after the log line :</p>
  
  <pre><code>        sql=insert into schema_batch_01.table_batch_donnees_massives values (:num_ligne,(((extract('epoch' from statement_timestamp())*1000)::bigint)-1407492647125)/1000,:prenom, :nom
      , :rue, :ville, :etat)
  </code></pre>
  
  <p>Do you have an idea why my JAR aborts without running the Job ? Thank you.</p>