150,267 questions
Score of 1
1 answer
96 views
Custom exception not caught by @RestControllerAdvice
I have a custom exception QuantityViolationException which I throw from a service method. I have a @RestControllerAdvice with a matching @ExceptionHandler for it, but instead of my handler returning ...
Score of 0
1 answer
108 views
Where to place a validation rule that depends on data from another table in a DDD Spring Boot app?
I have a Spring Boot app structured with a domain layer that is kept free of persistence dependencies. I'm trying to place a validation rule and can't find a clean home for it.
Domain model
...
Score of -1
0 answers
38 views
Conflicting dependencies between jackson and spring-hateoas:
I am using spring-boot-dependencies 3.5.16 to manage spring dependencies.
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.5.16"))
This defines
<spring-...
Score of 0
0 answers
205 views
+200
How to use Hibernate StatelessSession with open-in-view
We would like to use Hibernate StatelessSession injected into our Spring Data JPA repositories. Our understanding is this requires HibernateTransactionManager and SharedSessionCreator....
Score of 0
1 answer
119 views
Is there a reliable way to detect if a click had a real effect when app listeners may be attached later?
I'm building a Selenium based runner where non-technical users compose their own tests. Since the tests may target different web applications, I can't really rely on app specific assertions after a ...
Score of 0
1 answer
53 views
How to discard a message from inside a MessageConverter
It would be nice to be able to discard a message (ack it) without processing from inside the MessageConverter, but I have not been able to find a clean way to do it.
My current solution is to return ...
Score of 0
2 answers
92 views
Handling image data over WebSocket in Spring Boot
I am building a shooting game. The phone is connected to the server through WebSocket. On the client side, when the player hits "shoot", the phone will capture a picture and get the current ...
Score of 1
1 answer
66 views
can't find org.springframework.kafka.core.reactive.ReactiveKafkaConsumerTemplate
I'm building a springboot kafka app. While building a kafka consumer, I can't import org.springframework.kafka.core.reactive.ReactiveKafkaConsumerTemplate because this class can't be found.
I have ...
Score of 1
1 answer
87 views
Where can I find all the dependencies specified by Spring Boot's bill of materials?
Spring Boot provides a Maven bill of materials (BOM), that specifies the recommended versions of various Spring Boot dependencies. Some of these dependencies are Spring Boot starters such as org....
Score of 0
3 answers
207 views
JUnit Test cases failing after upgrading to Gradle 9, Springboot 4 and Java 25
After upgrading all the junit test cases which have dependency on spring-web are failing. Dependency analyzer shows that this artifact is not in the TestRuntimeClasspath scope and I am suspecting that ...
Score of 0
1 answer
106 views
Duplicate call of FilterChainProxy with SpringSecurity, MVC and StringResponseBody
I encounter a strange behaviour in my Spring-Boot project (v4.0.6):
When I execute a Controller which returns ResponseEntity<StraingResponseBody> for writing NDJSON-Lines the FilterChainProxy of ...
Score of 0
1 answer
272 views
How to configure RestClient timeout in Spring Boot 4?
Our existing Java Spring Boot 4 app injects a basic RestClient bean into several classes. The app does not make any other use of HTTP clients. Now I would like to configure the RestClient with some ...
Score of 1
1 answer
134 views
How does Spring Boot SecurityContextHolder works
I am quite struggling to understand how does even Spring
SecurityContextHolder
work internally I read too many articles but not able to understand it properly can anybody explain me how does it even ...
Score of 0
0 answers
69 views
SpringBoot init fails with jasypt password configured as env variable
Don't know why, bug pumped out all of a sudden.
Spingboot couldn't boot with code like below.
@Component("jasyptStringEncryptor")
class Sm4Encryptor(@param:Value($$"${jasypt.encryptor....
Score of 3
1 answer
138 views
Does @Order on a @Configuration class determine SecurityFilterChain precedence in Spring Security?
I'm trying to understand how Spring Security determines the order of multiple SecurityFilterChain beans.
The official documentation demonstrates applying @Order directly to the SecurityFilterChain ...