All Questions

Filter by
Sorted by
Tagged with
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? ******...
Jeff Cook's user avatar
  • 8,646
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 ...
Ganesh's user avatar
  • 1,033
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 ...
amacoder's user avatar
  • 801
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 ...
Evgeni Dimitrov's user avatar
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 ...
Andy's user avatar
  • 5,901
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 ...
Philippe's user avatar
  • 6,812
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 ...
underwood's user avatar
  • 863
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 ...
Damian's user avatar
  • 461
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) @...
Karthik Prasad's user avatar
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{ .. ...
wertigom's user avatar
  • 313
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 ...
escort's user avatar
  • 177
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 ...
kaveh.n's user avatar
  • 243
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-...
MeanwhileInHell's user avatar
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 ...
amacoder's user avatar
  • 801
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 ...
saurb's user avatar
  • 151
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. ...
Majky's user avatar
  • 1,973
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 (...
Chop's user avatar
  • 4,467
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 ...
LumberSzquatch's user avatar
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 ...
akcasoy's user avatar
  • 6,845
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 ...
Petar Tahchiev's user avatar
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 ...
caffeine_inquisitor's user avatar
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, ...
Timothy Clotworthy's user avatar
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 ...
newstackoverflowuser5555's user avatar
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. ...
Jeff Cook's user avatar
  • 8,646
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? ...
Maana's user avatar
  • 680
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>...
Hasan Can Saral's user avatar
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 ...
Kumar Sourav's user avatar
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 ...
ChriX's user avatar
  • 961
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....
usil's user avatar
  • 633
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....
kpentchev's user avatar
  • 3,070
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 ...
user avatar
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<...
balteo's user avatar
  • 24.1k
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(...
arklad's user avatar
  • 91
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....
James's user avatar
  • 3,014
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 ...
rram's user avatar
  • 2,004
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, ...
Prateek's user avatar
  • 11.3k
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....
Praveen Kumar's user avatar
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: ...
Mark Spangler's user avatar
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 ...
Jeff Cook's user avatar
  • 8,646
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....
Greg Potter's user avatar
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 ...
Nicolas's user avatar
  • 1,840
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 ...
Marcus Henrique's user avatar
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("...
James's user avatar
  • 3,014
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,...
Prabhakar D's user avatar
  • 1,084
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. ...
Edd's user avatar
  • 2,022
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 @...
s1moner3d's user avatar
  • 1,211
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 ...
Sabir Khan's user avatar
  • 9,994
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 ...
Eria's user avatar
  • 2,942
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 ...
Christian's user avatar
  • 840
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 ...
JR Utily's user avatar
  • 1,832

1
2 3 4 5
40