150,691 questions
0
votes
0
answers
11
views
Different name for hypermedia links attribute in json response after using RestTemplateBuilder for the first time (links vs _links)
Different name for hypermedia links attribute in json response after using RestTemplateBuilder for the first time (links vs _links).
We have adopted a legacy application which has several rest ...
-4
votes
0
answers
41
views
How to practice SpringBoot [closed]
I wish to learn SpringBoot, I'd like to practice the concepts that I've learnt and build simple projects out of it to stay strong with what I learn day to day.
Me being a java developer was not good ...
1
vote
0
answers
30
views
Spring WebClient takes too long to process the first request — subsequent calls fast
I'm using Spring WebClient in my Java application to authenticate with Keycloak.
The issue I'm facing is:
The first WebClient request takes a long time (5-9 seconds), but all subsequent requests are ...
-2
votes
1
answer
41
views
Spring Boot 4 versioning support for tests and springdoc REST OpenApi documentation failed with `MissingApiVersionException [closed]
In my project I've implemented Spring 7 versioning.
But MockMvc tests and springdoc REST OpenApi documentation failed with exception MissingApiVersionException
0
votes
2
answers
47
views
spring-cloud-gateway-webflux multiple Path predicates return 404
I’m having trouble with Spring Cloud Gateway (WebFlux) when I define multiple Path predicates for a single route.
Here is an example of my configuration in application.yml:
spring:
cloud:
...
Advice
1
vote
2
replies
43
views
ordering whole query by the field of multiset in jooq
in spring boot, i wanna have nested records, because if that i need to use multiset in my selects. then i need to order the whole query by fields in my multiset. but the problem is that i get a error ...
2
votes
1
answer
55
views
Spring Boot 4 + Kafka in transaction mode
I created a simple application which just sends in a loop messages to Kafka using KafkaTemplate with transaction mode. But, unfortunately, my code doesn't work with @Transactional in the new Spring. I ...
1
vote
3
answers
115
views
Using Pagination & Sorting in Spring Boot 4 with CrudRepository & PagingAndSortingRepository on JDBC
I am doing the learning on Broadcom's Spring Academy to be up to date with the latest best practices. I bumped Spring Boot to 4.0.0 instead of the 3.0.0 on Spring Academy. But I am having some issues ...
0
votes
1
answer
48
views
HTTP-403 when authentication in spring authentication server after /login in spring cloud gateway
I trying to setup cooperation of gateway and authorization server.
help me to find error in the program, when i authenticate me and enter to web authentication form username=admin and password=1 i ...
0
votes
1
answer
51
views
"Type argument is not within its bounds: must be subtype of 'Any'" in Kotlin application after upgrade to Spring Boot 4.0.0
After upgrading my Kotlin application from Spring Boot 3.5.8 to Spring Boot 4.0.0,
I get a lot of compiler errors
Type argument is not within its bounds: must be subtype of 'Any'.
How is it possible ...
0
votes
1
answer
112
views
Spring Boot: 400 Bad Request when sending JSON to POST endpoint (request body always null)
I’m building a Spring Boot REST API and I’m stuck on an issue that I can’t figure out.
I have a simple POST endpoint that should receive a JSON payload and map it to a DTO, but every time I call the ...
1
vote
1
answer
129
views
How to fail at startup in Spring Boot 4 if the base-url property is not set?
With Spring Boot 3, I created a @ConfigurationProperties record with @NotBlank validation to manually set the base URL on the RestClient that is passed to the HttpServiceProxyFactory For example:
@...
0
votes
0
answers
41
views
Spring Boot CORS preflight request returns 403 "Invalid CORS request" for POST /login
I’m trying to connect my React frontend (hosted on Azure Static Web Apps) to my Spring Boot backend (hosted on Azure App Service), but the CORS preflight request is failing with HTTP 403.
When I run ...
Best practices
0
votes
1
replies
48
views
Doing password rotation with spring-boot
I'm a DevOps engineer trying to implement password rotation for multiple services, some are Python, some Node but most are Kotlin and are using spring-boot, Our passwords are encrypted outside AWS and ...
0
votes
0
answers
22
views
Spring boot MultipartFile for most but Streaming for some
For most of my Controllers, I have a bean and optionally a MultipartFile @RequestParam and this works very nicely. It's good for files that are relatively small.
But separately I have a small number ...
1
vote
1
answer
348
views
Missed @AutoConfigureMockMvc in spring-boot-test-autoconfigure-4 (Spring Boot 4) [closed]
Impossible to import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
In spring-boot-starter-test missed org.springframework.boot.test.autoconfigure.web package.
0
votes
1
answer
115
views
In Spring Boot 4.0 ObjectMapper couldn't be @Autowired
Spring 3.x code after migration to Spring Boot 4.x give exception:
... required a bean of type 'com.fasterxml.jackson.databind.ObjectMapper' that could not be found
pom.xml
<dependency>
...
1
vote
1
answer
60
views
Spring Boot (4.0.0) Cannot Connect to MongoDB in Docker Compose Network
I'm trying to connect my Spring Boot application (using spring-boot-starter-data-mongodb) to a MongoDB instance within a shared Docker network managed by docker-compose.
The connection is failing, and ...
0
votes
0
answers
56
views
Cannot resolve symbol 'PathPatternRequestMatcher'
I have this Spring Security configuration for Spring cloud 2025.0.0:
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
private RequestMatcher[] permittedAntMatchers() {
...
-1
votes
0
answers
55
views
Spring Boot 3 WebFlux + Kotlin + @JsonValue wrapper fails for String / Boolean / Enum responses (ClassCastException)
I'm migrating a Kotlin + Spring WebFlux application from Spring Boot 2.5.x to Spring Boot 3.5.x, and several controller endpoints that used to work now consistently fail with ClassCastException.
🔍 ...
0
votes
1
answer
76
views
How to configure HTTP Service Clients with Protobuf in Spring Boot 4?
I want to use HTTP Service Clients with Spring Boot 4, but using Protobuf instead of JSON. How can I configure this?
1
vote
0
answers
22
views
Storing Domain Events directly in Outbox table vs mapping to Integration Events in Java/Spring (DDD based Microservices) [duplicate]
I have a Spring Boot / Java application following Domain-Driven Design and Event-Driven Architecture.
In my domain service, I create a ReservationCreatedEvent (a domain event) and publish it:
...
3
votes
1
answer
64
views
No longer see trace/span IDs after upgrading to spring boot 4
After upgrading to Spring Boot 4 I don't see any span/trace ids in my logs where I used to
@GetMapping
fun hello(): String {
logger.info("Hello World!")
return "Hello World!&...
1
vote
1
answer
93
views
Springboot custom validator in Service class is executed twice
I created a custom validator called @UniqueElementsById which I am applying as an annotation to Service method parameter like:
public interface MenuDetailService {
List<MenuDetail> ...
1
vote
1
answer
61
views
Customize spring data jpa repository's query to avoid fetch eager fields
Let's say I have a spring-boot-based project, that uses spring data jpa to define entities and map them to a postgres db.
The entity has some @ManyToOne annotatated "joins" - with eager ...
0
votes
1
answer
93
views
Error when running a Spring Boot image in Docker: open /workspace/BOOT-INF/classes/db: permission denied
I follow the book Cloud Native Spring in Action and I encountered this error. I used the Paketo Buildpacks to build the image using ./gradlew bootBuildImage. Full source code: https://github.com/...
Advice
2
votes
3
replies
108
views
Is Thymeleaf still maintained, and is there a Thymeleaf version compatible with Spring Boot 4 / Spring Framework 7?
Spring Boot 4.0 and Spring Framework 7.0 were recently released, and I’m considering upgrading my project.
However, my application uses Thymeleaf, specifically the thymeleaf-spring6 integration module,...
Best practices
0
votes
2
replies
44
views
Group and process unordered records in a CSV file with Spring Batch
A CSV file needs to be processed using Spring Batch where multiple rows could be grouped based on a field value. In the below sample, two lines in the CSV have the same GROUP_NAME with the value ...
1
vote
0
answers
90
views
Spring Boot @RestControllerAdvice works locally but not on Render deployment
I have a Spring Boot 3 application with a global exception handler that works perfectly when I run it locally, but when I deploy the same code to Render, the exception handling stops working — I only ...
Best practices
0
votes
1
replies
46
views
What is the best practice for creating a Docker image for Spring Boot applications using layers?
I am aware of two approaches. Below are Dockerfile snippets.
# This approach generates and runs application classes stored in the `extracted_layers/application/BOOT-INF/classes/` folder.
.
.
.
RUN ...
1
vote
1
answer
55
views
Drools cannot load DRL files from multiple folders inside Spring Boot executable JAR (LaunchedURLClassLoader issue)
I am using Drools 10.1.0 (drools-xml-support) with Spring Boot, and I have a kmodule.xml with two KBases, each pointing to a different folder.
In IntelliJ/IDE everything works perfectly.
But when I ...
0
votes
1
answer
58
views
@Value does not read variables from .env with spring-dotenv
I recently migrated from Spring Boot 3 to Spring Boot 4 and ran into an issue loading environment variables from a .env file. I was using:
<dependency>
<groupId>me.paulschwarz&...
0
votes
0
answers
52
views
Spring Boot with OpenTelemetry not exporting trace error events when ResponseEntity is returned
I am implementing Open Telemetry for Spring Boot 4.0 (spring-boot-starter-opentelemetry) trying to follow https://spring.io/blog/2025/11/18/opentelemetry-with-spring-boot. I have a simple controller:
@...
0
votes
0
answers
69
views
Netty ClientTransport.proxyWithSystemProperties() "early resolve" proxy address causing problem when proxy is unavailable but becomes available later
We are using Spring Boot 3.5.6 and using Netty to call a downstream HTTP system.
We create HttpClient and use proxyWithSystemProperties() to let netty create ProxyProvider using Java System Properties ...
2
votes
1
answer
140
views
Cannot find MockBean in Spring Boot 4.0.0
Spring Boot has released new version 4.0.0. They have provided migration guide. I am not able to find to where 'MockBean' annotation is moved. Currently I am importing starter-test, starter-kafka-test ...
Advice
0
votes
5
replies
163
views
Lightweight Spring Boot Setup for Beginners: Zed editor
I am new to Java and starting with Spring Boot development. I prefer using lightweight code editors like Zed, Lite-XL and Helix and want to avoid the high resource usage and complexity of full IDEs (...
-4
votes
0
answers
45
views
Returning audio or video from Spring Boot Restful Api [closed]
I need to be able to return audio or video from a Spring Boot Api. I cannot find any documentation for this. Could you help me find resources for this topic ?
0
votes
1
answer
71
views
Spring Authorization Server – /login keeps returning 403 instead of showing login page
I am learning Spring Authorization Server and trying to build a simple OAuth2 Authorization Server without OpenID Connect.
i want to handle the login page myself inside the same Authorization Server ...
4
votes
2
answers
184
views
SpringBoot4.0 Application Native Image must support at least Java 25
Because Spring Boot 4.0 was released, I tried to create a new repository and use it to generate a native image. After it was successfully generated, this error occurred when I tried to start it.
My ...
1
vote
1
answer
69
views
spring boot web polish characters encoding problem
In Spring Boot 2.6.0 java 8 application configuration class has content:
@Configuration
public class Internationalization implements WebMvcConfigurer {
// localeResolver, localeChangeInterceptor,...
0
votes
0
answers
42
views
Azure WebApp restart without killing properly the previous instance
I've a Spring Boot App deployed to an Azure App Service. Sometimes, the application is killed and relaunched, I don't known why. The main issue is not the application is restarted (it's an issue), but ...
-6
votes
0
answers
66
views
Push Notifications not working in my Vite + React + Spring Boot project (WebSockets, VAPID, AWS SNS, FCM all attempted) [closed]
I am trying to implement web push notifications in my project, but none of the approaches I tried are working. I’m not sure whether the issue is on the frontend, backend, service worker, or the push ...
1
vote
0
answers
41
views
IdempotencyBreachExceptionHandling in service used in kafka listener
I’m encountering an issue with possible idempotencyBreachException in a service used by Kafka listener.
I’m not entirely sure how to handle this situation correctly. I have a lockExecutor that locks a ...
0
votes
0
answers
56
views
"DefaultJpaDialect does not support custom isolation levels" when upgrading to spring batch 5
I am upgrading an app to newest Spring Boot 3, and because of that Spring Batch is upgraded to 5.2.3 (from 4.3.10).
The application did not persist batch states previously, it was using the "map ...
0
votes
0
answers
39
views
Spring Boot Dashboard in VS Code isn't displaying one of the project's modules
I'm setting up the environment for a project of the company I work for. It's a multi module backend runing Spring Boot. I didn't have problems with most of the setup, but one of the project's modules, ...
0
votes
1
answer
32
views
Jackson Mapping with Map<String, List<Object>>
I implemented a rest controller in my SpringBoot backend, which receives a json and maps it to an dto object via SpringBoots default Jackson configuration:
So we got:
The Rescontroller signed like ...
0
votes
0
answers
56
views
Spring Security 3.1.4 requestmatchers with Pathvariable
I have an unclear situation. I'm using a controller with any endpoints. I have a two methods with Get endpoints /short and /{idOrCode}. Pathvariable is a String type. Endpoint with this pathvariable ...
-1
votes
0
answers
38
views
Errors launching Spring Boot application with application configuration
I'm working on a Spring Boot application using IntelliJ IDEA. I can run the application locally with a Maven run configuration using the goal spring-boot:run, and it works as expected, I have also ...
1
vote
1
answer
289
views
DataJpaTest and AutoConfigureTestDatabase in Spring Boot 4.0.0
I have the following errors using Java 17 with Spring Boot 4.0.0:
Cannot resolve symbol 'DataJpaTest'
Cannot resolve symbol 'AutoConfigureTestDatabase'
The problem happens in a JUnit test class ...
0
votes
0
answers
43
views
Spring Data Elasticsearch adds new Date field as text in existing index mapping
I'm using Kotlin + Spring Boot 3.4.1 with spring-boot-starter-data-elasticsearch and Elasticsearch 8.12.2.
Existing document:
@Document(indexName = "crashes_summary")
data class CrashSummary(...