Skip to content

Commit 0b0f99c

Browse files
committed
fix: resolve JDK 25 class-file compatibility in spring-reactive tests
Spring Framework 6.1.6 (Boot 3.2.5) bundles an ASM version that cannot parse JDK 25 class files (major version 69), causing spring-reactive's @SpringBootTest integration tests to fail with ClassFormatException during classpath component scanning. - Bump spring-boot.version to 3.5.16 (Spring Framework 6.2.x, ASM 9.8+, real JDK 25 classfile support) and spring-cloud.version to the matching 2025.0.3 release train. - Drop the hardcoded slf4j-api/logback-classic version overrides so they're managed by the Spring Boot BOM again; the old pins were incompatible with the newer Boot version and caused NoSuchMethodError: LoggerContext.initCollisionMaps(). - Migrate spring-batch's SpringBatchConfig off JobBuilderFactory/ StepBuilderFactory (removed in the Spring Batch version bundled with Boot 3.5.x) to the JobRepository/JobBuilder/StepBuilder API. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 28c5bf3 commit 0b0f99c

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

pom.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
<properties>
2828
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
29-
<spring-boot.version>3.2.5</spring-boot.version>
30-
<spring-cloud.version>2023.0.0</spring-cloud.version>
29+
<spring-boot.version>3.5.16</spring-boot.version>
30+
<spring-cloud.version>2025.0.3</spring-cloud.version>
3131
<java.version>25</java.version>
3232
<junit-jupiter.version>5.10.1</junit-jupiter.version>
3333
</properties>
@@ -97,12 +97,10 @@
9797
<dependency>
9898
<groupId>org.slf4j</groupId>
9999
<artifactId>slf4j-api</artifactId>
100-
<version>2.0.9</version>
101100
</dependency>
102101
<dependency>
103102
<groupId>ch.qos.logback</groupId>
104103
<artifactId>logback-classic</artifactId>
105-
<version>1.4.14</version>
106104
</dependency>
107105

108106
<!-- Test Dependencies -->

spring-batch/src/main/java/org/milan/configuration/SpringBatchConfig.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
import org.springframework.batch.core.Job;
55
import org.springframework.batch.core.Step;
66
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
7-
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
8-
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
7+
import org.springframework.batch.core.job.builder.JobBuilder;
98
import org.springframework.batch.core.launch.support.RunIdIncrementer;
9+
import org.springframework.batch.core.repository.JobRepository;
10+
import org.springframework.batch.core.step.builder.StepBuilder;
1011
import org.springframework.batch.item.ItemProcessor;
1112
import org.springframework.batch.item.ItemReader;
1213
import org.springframework.batch.item.ItemWriter;
@@ -19,6 +20,7 @@
1920
import org.springframework.context.annotation.Bean;
2021
import org.springframework.context.annotation.Configuration;
2122
import org.springframework.core.io.Resource;
23+
import org.springframework.transaction.PlatformTransactionManager;
2224

2325
/**
2426
* Configuration for spring batch
@@ -30,18 +32,18 @@
3032
public class SpringBatchConfig {
3133

3234
@Bean
33-
public Job job(JobBuilderFactory jobBuilderFactory,
34-
StepBuilderFactory stepBuilderFactory,
35+
public Job job(JobRepository jobRepository,
36+
PlatformTransactionManager transactionManager,
3537
ItemReader<User> itemReader,
3638
ItemProcessor<User, User> itemProcessor,
3739
ItemWriter<User> itemWriter) {
38-
Step step = stepBuilderFactory.get("ETL-file-load")
39-
.<User, User>chunk(100)
40+
Step step = new StepBuilder("ETL-file-load", jobRepository)
41+
.<User, User>chunk(100, transactionManager)
4042
.reader(itemReader)
4143
.processor(itemProcessor)
4244
.writer(itemWriter)
4345
.build();
44-
return jobBuilderFactory.get("ETL-Load")
46+
return new JobBuilder("ETL-Load", jobRepository)
4547
.incrementer(new RunIdIncrementer())
4648
.start(step)
4749
.build();

0 commit comments

Comments
 (0)