212,905 questions
1
vote
2
answers
54
views
spring-boot-starter-aop jar is missing with Spring Boot 4.0.0
I created a proyect from https://start.spring.io/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http:/...
0
votes
0
answers
36
views
Spring Batch 5 doesen't load h2 script
I'm trying to run a job using Spring Batch 5 using h2 embeded db but i continue having a problem. Seems the spring batch h2 databse script isn't loaded.
This is my configuration class:
package ****....
0
votes
1
answer
62
views
Spring Boot: Adding a new HandlerInterceptor causes many existing tests to fail — how to fix or isolate it?
I have a large Spring Boot application with an extensive test suite (unit tests + controller tests).
After introducing a new HandlerInterceptor, many of my previously passing tests started failing. ...
1
vote
1
answer
28
views
Add my own type to PolymorphicTypeValidator with spring security 7.0.0 and Jackon 3?
Spring Security 7.0 introduces Jackson 3 support and in this new version of jackson lib, only Spring Security types are allowed by default in default PolymorphicTypeValidator .
The spring doc gives us ...
0
votes
1
answer
53
views
Logout does not return Principal after Spring boot upgrade to 3.1.9 or 3.5.8
I have my application in spring boot 3.1.4 and using okta for authentication.
I want to upgrade to spring-boot to 3.5.8. I am able to launch the application for the first time. During first logout, ...
0
votes
0
answers
24
views
React client receives only HTTP 401 without JSON error body, while Postman shows full 401 JSON response when JWT is expired
I am developing a Spring Boot application using JWT authentication.
When an access token is expired, the backend should return:
HTTP status: 401
JSON error body, for example:
{
"statusCode&...
0
votes
1
answer
75
views
Spring boot creates 2 security filter chains instead of 1 in spring boot 3.5.8
I'm migrating code from spring boot 2.7.5 to 3.5.8. Before the migration everything worked fine
Here is my internal security configuration in my library
@Configuration
@EnableWebSecurity
@...
1
vote
0
answers
43
views
Hibernate: How to keep PostgreSQL enum type up-to-date with Java enum?
I'm building a Spring server program which uses a PostgreSQL database. For one of the table columns, I want to restrict the possible values to a static pre-defined set, so I created a PostgreSQL enum ...
1
vote
1
answer
69
views
is @Transactional(isolation = Isolation.REPEATABLE_READ) enough for safe incrementing?
Is it possible to lost increment here? If not, is it possible in case of read_commited level?
@Transactional
public updateProductStatistics(Long productId) {
ProductStats stats = ...
Best practices
0
votes
2
replies
43
views
Avoiding duplicated Spring Bean classes that just have different field-level `@Value` annotations
Suppose that I have two classes that differ only in terms of their @Value "values" on their fields. For example:
@Component
public class BlueWidget {
@Value("${blue.message}")
...
1
vote
1
answer
31
views
Spring Data Couchbase @JsonAnySetter / @JsonAnyGetter support
I am working on a service that uses Spring Data Couchbase and I have an entity that maps some of the fields of a document and I need all the other fields to be mapped to a Map<String, Object>.
I ...
0
votes
1
answer
82
views
What is the new way of extending AbstractMappingJacksonResponseBodyAdvice with Jackson3?
With Spring 6 I use a @RestControllerAdvice on a class extending AbstractMappingJacksonResponseBodyAdvice . This class injects a SimpleFilterProvider in the MappingJacksonValue provided by the ...
2
votes
0
answers
72
views
Spring boot 4 and RestClient Mocking
I am in the process of migrating one of our application to Spring Boot 4.0.0. One of the changes I tried to incorporate is using the RestClient.
Code-wise all the changes are fine and everything is ...
Best practices
0
votes
0
replies
20
views
API Design for test-project
rn i'm making a test project in Spring framework for applying for an internship at a company. They requested to implement a simple bankcard managment system that "common" users and admins (...
Tooling
0
votes
2
replies
46
views
How to implement distributed tracing in Spring Boot 4 now that Spring Cloud Sleuth is removed?
I recently upgraded my project to Spring Boot 4, and I found that Spring Cloud Sleuth has been completely removed from the Spring ecosystem.
Previously, I used Sleuth + Zipkin for distributed tracing, ...