List of usage examples for org.springframework.batch.core JobParametersInvalidException getMessage
public String getMessage()
From source file:com.mkyong.AppJobAllExport.java
/** * @param args the command line arguments *//*w w w. j a va 2 s. c o m*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Export all csv to mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/csvexport/job-all-export.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher"); Job job = (Job) context.getBean("exportJob"); try { JobExecution execution = jobLauncher.run(job, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:com.mkyong.AppJobAllImport.java
/** * @param args the command line arguments *///from w w w . j av a 2s .c o m public static void main(String[] args) { fLogger.log(Level.INFO, "Import all csv to mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/csvimport/job-all-import.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher"); Job job = (Job) context.getBean("importJob"); try { JobExecution execution = jobLauncher.run(job, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:com.mkyong.AppJobCityImport.java
/** * @param args the command line arguments *//*w w w. j av a 2s. c om*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Import city csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/csvimport/job-city-import.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobCityLauncher = (JobLauncher) context.getBean("jobLauncher"); Job cityJob = (Job) context.getBean("cityImportJob"); try { JobExecution execution = jobCityLauncher.run(cityJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:com.mkyong.AppJobReportImport.java
/** * @param args the command line arguments *//* w w w .j av a2 s .c o m*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Import report csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/csvimport/job-report-import.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobCityLauncher = (JobLauncher) context.getBean("jobLauncher"); Job reportJob = (Job) context.getBean("reportImportJob"); try { JobExecution execution = jobCityLauncher.run(reportJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:pl.mariuszczarny.springbatchforslask.main.AppJobAllImport.java
/** * @param args the command line arguments *//*from ww w . j a va 2 s .c o m*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Import all csv to mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/job-all-import.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobLauncher = (JobLauncher) context.getBean("jobLauncher"); Job job = (Job) context.getBean("importJob"); try { JobExecution execution = jobLauncher.run(job, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:pl.mariuszczarny.springbatchforslask.main.fromcsv.ArrangeExport.java
/** * @param args the command line arguments *///from www . ja va 2s . c om public static void main(String[] args) { fLogger.log(Level.INFO, "Import city csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/fromdb/city.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobCityLauncher = (JobLauncher) context.getBean("jobLauncher"); Job cityJob = (Job) context.getBean("cityImportJob"); try { JobExecution execution = jobCityLauncher.run(cityJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:pl.mariuszczarny.springbatchforslask.main.fromdb.ArrangeImport.java
/** * @param args the command line arguments *//* w w w . j a va 2s. co m*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Import arrange csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/fromdb/arrange.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobArrangeLauncher = (JobLauncher) context.getBean("jobLauncher"); Job arrangeJob = (Job) context.getBean("arrangeImportJob"); try { JobExecution execution = jobArrangeLauncher.run(arrangeJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:pl.mariuszczarny.springbatchforslask.main.fromdb.ClubImport.java
/** * @param args the command line arguments *//* w w w. j av a2 s . co m*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Import club csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/fromdb/club.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobCityLauncher = (JobLauncher) context.getBean("jobLauncher"); Job clubJob = (Job) context.getBean("clubImportJob"); try { JobExecution execution = jobCityLauncher.run(clubJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:pl.mariuszczarny.springbatchforslask.main.fromdb.CoachImport.java
/** * @param args the command line arguments */// w w w. j av a 2 s . com public static void main(String[] args) { fLogger.log(Level.INFO, "Import coach csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/fromdb/coach.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobCoachLauncher = (JobLauncher) context.getBean("jobLauncher"); Job coachJob = (Job) context.getBean("coachImportJob"); try { JobExecution execution = jobCoachLauncher.run(coachJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }
From source file:pl.mariuszczarny.springbatchforslask.main.fromdb.ContractImport.java
/** * @param args the command line arguments *//*w ww . j a v a2 s . c om*/ public static void main(String[] args) { fLogger.log(Level.INFO, "Import contract csv from mysql"); String[] springConfig = { "spring/batch/config/database.xml", "spring/batch/config/context.xml", "spring/batch/jobs/fromdb/contract.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(springConfig); JobLauncher jobContractLauncher = (JobLauncher) context.getBean("jobLauncher"); Job contractJob = (Job) context.getBean("contractImportJob"); try { JobExecution execution = jobContractLauncher.run(contractJob, new JobParameters()); fLogger.log(Level.INFO, "Exit Status : {0}", execution.getStatus()); } catch (JobParametersInvalidException e) { e.getMessage(); } catch (JobExecutionAlreadyRunningException e) { e.getMessage(); } catch (JobInstanceAlreadyCompleteException e) { e.getMessage(); } catch (JobRestartException e) { e.getMessage(); } fLogger.log(Level.INFO, "Done"); }