spring-projects / spring-projects/spring-boot
Configuration properties of type Class should not require a dedicated reflection hint to be bound on native
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
Native builds of applications based on Spring Boot 4.1.0-RC1 fail to start if it has dependencies on either:
- spring-boot-starter-validation
- spring-boot-starter-kafka
To reproduce the errors, use the attached zipped application and run the following commands:
1. spring-boot-starter-validation
./gradlew bootBuildImage
docker run sb41-native-demo:0.0.1-SNAPSHOT
The start will fail with the error message:
Caused by: java.lang.IllegalArgumentException: Invalid logger interface org.hibernate.validator.internal.util.logging.Log (implementation not found)
For a full log, see sb410rc1-native-validator-error.log.
2. spring-boot-starter-kafka
First, remove the dependency on spring-boot-starter-validation and remove all annotations in src/main/java/com/example/sb41_native_demo/AppProperties.java that come from that dependency.
Next, run the commands:
./gradlew bootBuildImage
docker run sb41-native-demo:0.0.1-SNAPSHOT
The start will fail with the error message:
Failed to bind properties under 'spring.kafka.consumer.key-deserializer' to java.lang.Class<?>:
For a full log, see sb410rc1-native-kafka-error.log.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached sb41-native-demo.zip and reproduce both failures using the documented bootBuildImage and docker run commands. Inspect AppProperties.java and the full validator and Kafka error logs, then trace the native configuration-property binding path. Done means both applications start successfully without requiring a dedicated reflection hint for Class-valued properties.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100