All Questions
Tagged with spring-boot spring-batch
1,979
questions
358
votes
52
answers
1.2m
views
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured
I am working on a Spring Boot Batch example with MongoDB and I have already started the mongod server.
When I launch my application, I am getting the error below.
Any pointers for this issue?
******...
86
votes
31
answers
380k
views
Parameter 0 of constructor in required a bean of type 'java.lang.String' that could not be found
I am working on spring batch with spring boot 2.X application, actually its existing code i am checked out from git. While running the application it fails due to below error only for me and same code ...
48
votes
7
answers
89k
views
How to java-configure separate datasources for spring batch data and business data? Should I even do it?
My main job does only read operations and the other one does some writing but on MyISAM engine which ignores transactions, so I wouldn't require necessarily transaction support. How can I configure ...
44
votes
2
answers
36k
views
How Spring Boot run batch jobs
I followed this sample for Spring Batch with Boot.
When you run the main method the job is executed.
This way I can't figure out how one can control the job execution. For example how you schedule a ...
41
votes
8
answers
47k
views
javax.management.InstanceNotFoundException: org.springframework.boot:type=Admin,name=SpringApplication
I developed a Spring boot application and the functionality of the application is working fine. However, at the time of startup, I see the below exception multiple times.
When I ran the same ...
26
votes
3
answers
59k
views
How do I set JobParameters in spring batch with spring-boot
I followed the guide at http://spring.io/guides/gs/batch-processing/ but it describes a job with no configurable parameters. I'm using Maven to build my project.
I'm porting an existing job that I ...
25
votes
1
answer
16k
views
ETL in Java Spring Batch vs Apache Spark Benchmarking
I have been working with Apache Spark + Scala for over 5 years now (Academic and Professional experiences). I always found Spark/Scala to be one of the robust combos for building any kind of Batch or ...
22
votes
3
answers
41k
views
run spring batch job from the controller
I am trying to run my batch job from a controller. It will be either fired up by a cron job or by accessing a specific link.
I am using Spring Boot, no XML just annotations.
In my current setting I ...
21
votes
7
answers
35k
views
Spring batch scope issue while using spring boot
I'm having Standalone spring batch job. This works perfectly fine when in JUNIT
@RunWith(SpringJUnit4ClassRunner.class)
//@SpringApplicationConfiguration(classes = KPBootApplication.class)
@...
18
votes
2
answers
19k
views
What is the difference between spring scheduled tasks and spring batch jobs
I dont understand the difference between scheduled tasks and batch jobs in spring.
By scheduled tasks I mean the ones which are configured like these:
@EnableScheduling
public class AppConfig{
..
...
17
votes
18
answers
127k
views
Caused by: java.io.FileNotFoundException: class path resource [application.properties] cannot be opened because it does not exist
I am creating an spring boot Batch application. That Batch loads data from postgres and insert into MongoDB. I have written the code , but while running the spring boot application, its shows error ...
17
votes
2
answers
18k
views
Spring boot integration with spring batch and jpa
I am integrating a spring boot project with a spring batch and data jpa project . All stuff related to job and data configuration is right except , persisting my job writer result in database . after ...
16
votes
7
answers
23k
views
Spring Batch / Postgres : ERROR: relation "batch_job_instance" does not exist
I am trying to configure Spring Batch to use PostGres DB. I have included the following dependencies in my build.gradle.kts file:
implementation("org.springframework.boot:spring-boot-starter-...
15
votes
4
answers
35k
views
how to select which spring batch job to run based on application argument - spring boot java config
I have two independent spring batch jobs in the same project because I want to use the same infrastructure-related beans. Everything is configured in Java. I would like to know if there's a proper way ...
15
votes
3
answers
16k
views
Prevent Spring Batch automatic job trigger after context creation without Spring Boot
I am setting up a project with Spring Batch without using Spring Boot.
When the Spring application context is created, all the jobs get executed.
I tried adding spring.batch.job.enbled=false to the ...
14
votes
5
answers
36k
views
Spring boot + spring batch without DataSource
I'm trying to configure spring batch inside spring boot project and I want to use it without data source. I've found that ResourcelessTransactionManager is the way to go but I cannot make it work. ...
14
votes
2
answers
6k
views
Change Spring Boot project to inherit custom dependency management
I have a small Spring Boot application which I must adapt to use a custom parent. Google finds lots of examples of how to migrate to Spring Boot, but I am at a loss as to migrate from Spring Boot (...
13
votes
1
answer
21k
views
What is the function of JobBuilderFactory.get(job).incrementer(RunIdIncrementer)?
I'm developing a Spring-Batch project using Spring-Boot and everything is going along nicely. I've done a few spring-batch examples (including some from spring.io), but I'm not sure what some of the ...
12
votes
4
answers
41k
views
How to trigger a scheduled Spring Batch Job?
I want to be able to start my job with a REST controller, then when the job is started, it should run on a scheduled basis, until i stop it again with REST.
So this is my Controller:
@RestController
...
11
votes
6
answers
32k
views
Spring batch A job instance already exists
OK,
I know this has been asked before, but I still can't find a definite answer to my question. And my question is this: I am using spring batch to export data to SOLR search server. It needs to run ...
11
votes
2
answers
31k
views
Spring Batch skip exception for ItemWriter
I'm trying to use Spring Batch 2.2.5 with Java config. Here is the config that I have:
@Configuration
@EnableBatchProcessing
public class JobConfiguration {
@Autowired
private ...
11
votes
2
answers
10k
views
SpringBatch - Step no longer executing: Step already complete or not restartable
I have a single step springbatch application. The job is as follows:
@Bean
public Job databaseCursorJob(@Qualifier("databaseCursorStep") Step exampleJobStep,
...
10
votes
3
answers
37k
views
How to run multiple jobs in spring batch using annotations
I am using Spring Boot + Spring Batch (annotation) , have come across a scenario where I have to run 2 jobs.
I have Employee and Salary records which needs to updated using spring batch. I have ...
10
votes
1
answer
17k
views
Invalid bean definition with name 'employeesJob' defined in class path resource: factory-bean reference points back to the same bean definition
I went through this link : Spring Bean Inheritance Using Annotations Bean reference back issue and other links as well, but it did not solved my issue yet.
I am working on Spring Boot Batch example. ...
10
votes
3
answers
15k
views
java.lang.IllegalStateException: InputStream has already been read - do not use InputStreamResource if a stream needs to be read multiple times
I am trying to read a file from aws s3 bucket and set it as resource inside my spring batch reader class. When I test the application on aws lambda function I got below error. any suggestion experts?
...
10
votes
1
answer
16k
views
java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.atDebug() with poi-ooxml
I have:
<dependencies>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-xml -->
<dependency>
<groupId>...
10
votes
1
answer
25k
views
How to solve deprecation warning of JobBuilderFactory and StepBuilderFactory
I'm using the following factories to set up my Spring Batch application:
private JobBuilderFactory jobBuilderFactory;
private StepBuilderFactory stepBuilderFactory;
However, I'm getting the following ...
9
votes
5
answers
22k
views
Define an in-memory JobRepository
I'm testing Spring Batch using Spring boot. My need is to define jobs working on an Oracle Database but I don't want to save jobs and steps states inside this DB.
I've read in the documentation I can ...
9
votes
1
answer
20k
views
FlatFileParseException Parsing error - Spring Batch
I follow this tutorial and I'm getting FlatFileParseException error:
org.springframework.batch.item.file.FlatFileParseException: Parsing
error at line: 1 in resource=[class path resource [country....
9
votes
4
answers
15k
views
Spring Batch 4.2.4: Unable to deserialize the execution context
I was using spring-batch:4.2.2.RELEASE as part of spring-boot-starter-batch:2.2.4.RELEASE.
After upgrading the latter to version 2.3.1.RELEASE, I get the following exception when starting a job:
java....
9
votes
1
answer
7k
views
Spring batch. How to chain multiple itemProcessors with different types?
i have to compose 2 processors as following :
processor 1 implement the itemProcessor Interface with itemProcessor<A,B> (transforming data).
processor 2 implement the itemProcessor Interface ...
9
votes
2
answers
12k
views
Persist issue with a spring batch ItemWriter using a JPA repository
I have an issue with a spring batch ItemWriter that relies on a JPA repository in order to update data.
Here it is:
@Component
public class MessagesDigestMailerItemWriter implements ItemWriter<...
9
votes
3
answers
4k
views
Cannot resolve bean in SpEL for Spring Data MongoDB collection name
I am trying to customize the collection name where an entity class is saved into and indexed, using Spring Data MongoDB and Spring Batch. The class is declared as follows:
@Document
@CompoundIndex(...
9
votes
1
answer
14k
views
How to configure EntityManagerFactoryBuilder bean when testing Spring Boot Batch application?
I have a Spring Boot Batch application that I'm writing integration tests against. However, I'm getting the following error about the EntityManagerFactoryBuilder bean missing when running a test:
org....
8
votes
8
answers
28k
views
How to launch Spring Batch Job Asynchronously
I have followed the spring batch doc and couldn't get my job running Asynchronously.
So I am running the Job from a web container and the job will be triggered via a REST end point.
I wanted to get ...
8
votes
4
answers
15k
views
Property spring.datasource.schema with value 'class path resource [schema-mysql.sql]' is invalid: The specified resource does not exist
I am developing Spring Boot + Batch very basic example. Version of Boot is 2.1.1.RELEASE. In this example, I used schema-mysql.sql and expecting to create the Batch metadata examples automatically, ...
8
votes
4
answers
101k
views
Failed to execute CommandLineRunner - Spring Batch
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....
8
votes
3
answers
26k
views
Duplicate Spring Batch Job Instance
I have a small sample Spring Batch application that when started for the first time will work fine but whenever I shut the application down & restart the jar I always get this error:
Caused by: ...
8
votes
3
answers
20k
views
Caused by: java.lang.IllegalArgumentException: Unable to deserialize the execution context in Spring Batch
I am developing Spring Boot + Batch XML based approach. In this example, I have created following classes. When I simply load or class the Spring Batch Job. I get the below error.
I web search links ...
8
votes
3
answers
19k
views
Spring Batch Java Config JobLauncherTestUtils
I am currently working on a spring boot project that uses spring batch. I am trying to use JavaConfig instead of xml but it's difficult with all of the docs currently in xml.
I followed https://blog....
8
votes
3
answers
4k
views
Vulnerability warning with XStreamMarshaller
When using a XStreamMarshaller with spring batch, I get the following message:
Security framework of XStream not initialized, XStream is probably vulnerable.
First try: According to the ...
8
votes
6
answers
41k
views
Unable to detect database type
I'm trying to create a Spring Boot application using sqljdbc4 driver with this config:
spring:
datasource:
url: "jdbc:sqlserver://dbhost:1433;databaseName=test"
username: dbuser
...
8
votes
4
answers
3k
views
Spring Batch - How to prevent database commits with jobLauncherTestUtils
I have Spring Batch job that writes to the database (it has a step with a JpaItemWriter). I have an integration test such as follows:
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("...
8
votes
1
answer
2k
views
TransactionRequiredException: no transaction is in progress while using JPAItemWriter
I am facing weird issue with an application which is a spring boot application.
Details Here:
The app has a spring batch job which uses JpaItemWriter for performing the writes to the database.
Also,...
8
votes
1
answer
5k
views
Single job execution across multiple servers
I have setup where multiple servers run a @Schedule which run a spring batch job that sends out emails to users. I want to make sure that only one instance of this job is ran across multiple servers.
...
8
votes
0
answers
4k
views
Spring Batch + Spring Boot - shutdown process
I'm new to Spring Batch and I can't figure out how to terminate the Spring Boot process after job is finished.
In my BatchConfiguration class i configure jobs and steps:
@Configuration
@...
7
votes
4
answers
13k
views
SpringBoot JNDI datasource throws java.lang.ClassNotFoundException: org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory
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 ...
7
votes
3
answers
11k
views
Batch with Spring Boot & JPA - use in-memory datasource for batch-related tables
Context
I'm trying to develop a batch service with Spring Boot, using JPA Repository. Using two different datasources, I want the batch-related tables created in a in-memory database, so that it does ...
7
votes
4
answers
11k
views
Unable to deserialize ExecutionContext: the class with [... Class] and name of [... Class] is not trusted
I'm working with SpringBoot 2.4.2 and SpringBatch. Deserialization fails with the following stacktrace:
2021-03-29 15:51:28.529 ERROR 30308 --- [ main] o.s.boot.SpringApplication ...
7
votes
4
answers
15k
views
Spring Boot CommandLineRunner : filter option argument
Considering a Spring Boot CommandLineRunner Application, I would like to know how to filter the "switch" options passed to Spring Boot as externalized configuration.
For example, with:
@Component
...