spring-batch

Failed to execute CommandLineRunner - Spring Batch

百般思念 提交于 2019-12-01 06:38:09
Hi I am very new to Spring batch and I am getting the following exception which I am not able to resolve: java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:800) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:781) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) [spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot

How to get job id using spring expression language?

笑着哭i 提交于 2019-12-01 06:24:27
I want to get job id using spring expression language. I tried #{jobExecutionContext[jobId]} but it does not work. Using SpEL alone, there is no way to access the job id. You could use a JobExecutionListener to add it to the executionContext and then it would be available via what you are trying. emeraldjava A worked example would look like this. Your JobExecutionListener class has access to the JobExecution and it copies the jobId to the executionContext. public class JobIdToContextExecutionListener implements JobExecutionListener { public void beforeJob(JobExecution jobExecution) { long

Java Spring Batch using embedded database for metadata and a second database for other data

断了今生、忘了曾经 提交于 2019-12-01 06:18:12
问题 I'm having a bit of trouble with Spring Batch. I am in this situation: I have to analyze the data inside a file and insert everything in a database (Oracle). The problem I am facing is that when I try to configure the database used to save the data the application crashes and closes. I have this error message: :: Spring Boot :: (v2.0.0.RELEASE) 2018-03-28 17:21:25.033 INFO 9912 --- [ main] c.e.demo.SpringMultiprocessApplication : Starting SpringMultiprocessApplication on XXXel with PID 9912

java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V

六月ゝ 毕业季﹏ 提交于 2019-12-01 06:17:07
Below is the pom.xml of my spring batch project and I get the below exception if I deploy in jboss 5 , but the same war works fine if I deploy in local windows machine. I suspect there is a conflict in jar with respect to org.springframework:spring-context:jar:2.5.6 . Even I tried excluding the spring core jar in spring batch dependency, but I couldn't resolve this can anyone help thanks in advance.Is there a way to exclude spring-context:jar:2.5.6 Error Trace java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V at org

SpringBoot JNDI datasource throws java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory

一世执手 提交于 2019-12-01 05:52:46
Similar questions have been asked before and I went through all of those but not able to solve problem. Related Questions - Q1 , Q2 , Q3 , Q4 , Q5 , Q6 I have a Spring Batch project with Spring Boot and trying to use DB connection pools. I am using embedded tomcat container with version 8.5.x. Everything works fine if I use application.properties to specify data source and pool settings. But when I try to use JNDI, I get exception - Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory I don't see any jar names tomcat-dbcp-** in Maven jars so I am not

Spring Batch Table Prefix when using Java Config

◇◆丶佛笑我妖孽 提交于 2019-12-01 05:37:03
My Spring Batch repository (deployed on an Oracle database) lies in a different schema such that I need to prepend the schema name. When using XML configuration, this would be easy to do: <job-repository id="jobRepository" table-prefix="GFA.BATCH_" /> However, as I use Java Config, this turns out to be more tricky. The best solution I found is to have my Java Config class extend DefaultBatchConfigurer and override the createJobRepository() method: @Configuration @EnableBatchProcessing public class BatchConfiguration extends DefaultBatchConfigurer{ @Autowired private DataSource dataSource;

Calling Async REST api from spring batch processor

纵然是瞬间 提交于 2019-12-01 05:29:49
问题 I wrote a spring batch job that processes List of Lists. Reader returns List of List. Processor works on each ListItem and returns processed List. Writer writes stuff to DB and sftp from List of List. I have a use case where I call Async REST api from spring batch processor. On ListenableFuture response I implemented LitenableFutureCallback to handle success and failure, which works as expected, but before the async call returns something, ItemProcessor dosen't wait for call backs from async

Can't Import properties after integrating spring-batch-admin into existed spring boot

邮差的信 提交于 2019-12-01 05:18:08
问题 I have worked on a project using spring-batch and spring-boot. I followed the exact rules how to integrate it by: 1. removing all @EnableBatchProcessing 2. adding ServletConfiguration and WebappConfiguration (and also import them using @Import({ ServletConfiguration.class, WebappConfiguration.class }) add props: batch-mysql.properties business-schema-mysql and modified application.properties with: server.servletPath=/* spring.freemarker.checkTemplateLocation=false ENVIRONMENT=mysql Now here

java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V

老子叫甜甜 提交于 2019-12-01 04:51:47
问题 Below is the pom.xml of my spring batch project and I get the below exception if I deploy in jboss 5 , but the same war works fine if I deploy in local windows machine. I suspect there is a conflict in jar with respect to org.springframework:spring-context:jar:2.5.6 . Even I tried excluding the spring core jar in spring batch dependency, but I couldn't resolve this can anyone help thanks in advance.Is there a way to exclude spring-context:jar:2.5.6 Error Trace java.lang.NoSuchMethodError: org

Spring-batch flow / split after a step

断了今生、忘了曾经 提交于 2019-12-01 04:11:18
I am building a spring-batch solution that contains the following process: step 1 : split a list into multiple lists step 2 : process each sub-list step 3 : merge sub-lists The generated sub-lists can be processed in parallel, and according to the spring-batch documentation this is supported. Sadly I can only find spring-batch example jobs that start with parallel steps, not examples that start out sequentially. The following job will not compile. Spring gives me an error: 'cannot resolve step2' <batch:job id="webServiceJob2"> <batch:step id="step1" next="step2"></batch:step> <batch:split id=