58,880 questions
1
vote
3
answers
110
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 ...
Advice
0
votes
1
replies
23
views
Silent SSO with Auth0 in legacy Spring MVC (SSR) app with LDAP login and Spring Security 5
How to implement Auth0 Universal Login + Silent SSO + SLO in a legacy Spring MVC (SSR) app? Can the Auth0 SPA SDK be used?
I have a legacy Spring MVC (server-side rendered) application using:
Spring ...
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 ...
0
votes
0
answers
42
views
Spring throws UnknownContentTypeException for empty json object property
I'm working with 2 component with Spring MVC that shares a REST API protocol.
The server gives this answer:
{
"id":1,
"alerts": {}
}
Both shares the same class to map this ...
-1
votes
0
answers
41
views
java.lang.IllegalStateException: getAttribute: Session already invalidated when calling API locally [duplicate]
I am getting the following exception when I hit my API on my local server:
java.lang.IllegalStateException: getAttribute: Session already invalidated
[INFO ] 2025-11-24 17:32:55.729 [http-nio-8080-...
0
votes
1
answer
53
views
@RestController in existing spring-mvc servlet in Spring Framework 4.3 [closed]
I am maintaining a Spring 4.3 MVC app, upgrading it is a complicated and long term task. For my setup, XML-based, I did not find much on the internet, mostly Spring Boot stuff. I tried adding a @...
1
vote
0
answers
61
views
Spring: How to redirect back to the form after authenticating its POST request?
I have got a (Thymeleaf) form which I have made accessible to all users, even to those who are not logged in, in order to improve the UX. Only submitting the form (through a POST request) requires ...
0
votes
0
answers
23
views
How can I use a custom Date deserializer for Json RequestBody?
I'm using Spring MVC and I would like to control the deserialization of Date objects in RequestBody.
I saw I can set a custom JsonDeserializer in the input object, but I would like to set a global ...
2
votes
1
answer
53
views
Can a Spring Framework 7.x WAR run on a Jakarta EE 10 server?
I’m working on a web application which is packaged as a WAR that I’m planning to upgrade to Spring Framework 7.x. I noticed that Spring 7 requires Jakarta EE 11, but the environment I need to deploy ...
2
votes
1
answer
80
views
Login infinitely retrying with bad credentials
I am using Java Spring boot and Thymeleaf. When trying to login with bad credentials, the page freezes for a few minutes, and it says the page isn't working.
When I activate debug in application....
1
vote
1
answer
64
views
RequestDispatcher forward(request,response) works in Tomcat 10 but not in Tomcat 11
I'm in the process of doing a technology upgrade for a Spring mvc app. I'm currently using Java 21, Spring 6, and Thymeleaf 3. I've tested the application thoroughly, running it on Tomcat 10. The app ...
1
vote
1
answer
88
views
Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Since more than one mappable servlet in your servlet context:
I am applying Spring Security in a Spring MVC (Spring Boot) application. The application already has CSRF and Session Management and I want to apply JWT Authentication along with Spring security. But ...
Best practices
1
vote
1
replies
62
views
spring UriComponents tobuilder to UriComponentsBuilder
It seems Spring has two classes to represent URLs efficiently, UriComponentsBuilder and UriComponents.
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("https://stackoverflow.com&...
2
votes
1
answer
102
views
Spring-Web OOM when streaming after update from 6.0.23 to version 6.1.4 and above
We have an application where we are streaming files from the filesystem and are PUTting them to an endpoint.
This worked fine up to spring-web version 6.0.23.
After updating to version 6.1.4, we ...
0
votes
1
answer
57
views
Spring MVC Json decoder to accept both string and long millis values
Is there any way to make Spring decodes both string (es. yyyy-mm-dd HH:MM:ss) and long (unixtime milliseconds) for Date objects?
0
votes
1
answer
115
views
Spring Boot 3.x — @RestControllerAdvice not catching custom exceptions
I recently upgraded to Spring Boot 3.5 (Jakarta packages) and noticed my global exception handler isn’t being triggered.
@RestController
public class UserController {
@GetMapping("/test")...
0
votes
1
answer
89
views
Spring Boot: Redirecting URLs ending in slash to without slash
I want to redirect all routes like /api/user/home/ to /api/user/home. Here is the configuration file for gateway:
spring:
application:
name: gateway
cloud:
gateway:
routes:
-...
-3
votes
1
answer
105
views
Why does my /ping route return 404 in a Spring MVC app (not Spring Boot)?
I'm working on my first Spring MVC project (not Spring Boot), and I’m running into a 404 issue when calling the /ping route for a health check.
I have a simple PingController defined like this:
...
0
votes
1
answer
60
views
How to use different DTOs in the same @ModelAttribute between GET and POST in Spring MVC?
I'm working on a Spring Boot + Thymeleaf application where I have an edit page.
In my controller, I want to use different DTOs for the GET and POST methods:
ResponseDto for displaying data and ...
0
votes
1
answer
60
views
spring boot exposing rest over tls vs consuming tls
In a spring boot application, I have to expose apis over tls/https and at the same time, I have to consume other apis that are exposed over tls/https. What is the best way to configure the truststore ...
1
vote
0
answers
63
views
Spring Security 5 (Spring Boot 2.7) update to 6 (Spring Boot 3.2) causes different Response, HTTP.302 instead of HTTP.200
I'm struggeling with an Spring Boot Update of my service, from Spring Boot 2.7 to 3.2.
This update includes an update of Spring Security 5.7 to 6.1. The class WebSecurityConfigurerAdapter is no longer ...
0
votes
0
answers
74
views
Thymeleaf TemplateInputException when injecting dynamic fragment via ${content} in layout.html (Spring Boot 3.5.6)
I'm using Spring Boot 3.5.6 with Thymeleaf 3.1.3, and I'm trying to implement a dynamic layout system where I inject a fragment into layout.html using a model attribute.
Controller:
@GetMapping("/...
0
votes
0
answers
155
views
Spring Boot. Error starting ApplicationContext
I've faced with the following error while starting my spring boot application:
Error starting ApplicationContext.
org.springframework.beans.factory.UnsatisfiedDependencyException:Error creating bean ...
0
votes
0
answers
114
views
I can't find io.modelcontextprotocol.sdk
I have a task to implement a streaming HTTP MCP server in Spring Boot. I injected the dependencies as follows:
<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<...
0
votes
0
answers
43
views
How to use Qmatic SDK connectors (e.g., BranchConnector) in a Spring Boot application?
The Qmatic SDK documentation mentions that we can use their connectors (for example, BranchConnector) to retrieve data from the Qmatic system instead of calling the REST API directly.
However, the ...
0
votes
0
answers
65
views
Spring Migration - getting NoClassDefFoundError during application bootrun
I am in the process of migrating spring boot to version 3.5.6 (from 2.2.2).
I am getting the following error while running the boot run for the main class
Error: Could not find or load main class com....
0
votes
0
answers
64
views
How to migrate legacy Spring MVC Form Controllers (`AbstractFormController`) to annotation-based controllers in newer Spring versions?
I’m upgrading a legacy Java Spring MVC application.
Current setup:
Java 1.8 (recently upgraded from Java 1.7)
Spring 3.2.18
Uses the old AbstractFormController, SimpleFormController, and XML-based ...
1
vote
0
answers
73
views
Why does spring.thymeleaf.enabled break Spring Boot 3.5.0+?
I was testing a different Spring Boot + Thymeleaf example projects using 3.5.5 and the Thymeleaf view seemed to break if the 'spring.thymeleaf.enabled' setting was in application.properties. It didn't ...
0
votes
0
answers
73
views
Map snake_case query params to an object with Bean Validation
I’m building an API with Spring Boot + Kotlin and I have a scenario where a GET endpoint receives several query parameters. Instead of declaring many @RequestParam in the controller, I’d like to group ...
0
votes
0
answers
43
views
Does exists a pattern for Spring MVC Framework to handle progressive job?
I have to improve an import job in my web app made with Spring MVC Framework.
This job can take a bit then would be great to give the user the progression and the possibility to interrupt it.
I'm ...
1
vote
1
answer
91
views
No qualifying bean of type 'org.springframework.boot.web.server.test.client.TestRestTemplate' available
I'm trying to test my @RestController, but it doesn't work, giving me the error
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studio.abos.springcalc....
-4
votes
1
answer
58
views
JSL-Springboot security login page redirecting infinitely (ERR_TOO_MANY_REDIRECTS)
/login page seems to be stuck in a loop of being redirected to self.
For context, I want /register & /login to be visible without authentication, while all other pages in my project should ...
0
votes
0
answers
133
views
RabbitMQ error connection in Spring Application - getsockotp
I’m building a Spring Boot application that uses RabbitMQ.
Here is my current setup:
application.properties
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
...
2
votes
1
answer
72
views
Set response redirect to 301 status
Right now, I have a web application that returns a redirect response if certain conditions are met. That comes back to the browser as a 302 redirect. I would like it to be a 301 redirect instead.
I ...
1
vote
1
answer
58
views
Two API with same structure but when calling from postman one is working without sessionid and credential and another is not working
I have created two api's in my spring mvc project which have identical structure. But while calling using Postman or while hitting the APIs in browser/UI project, one is working without any credential ...
0
votes
0
answers
48
views
Springboot Web mapping same controller as 2 beans
I'm generating controller code from openapi3 spec using gradle openapi generator plugin 6.3.0.
Generate, compile works fine, but getting a runtime error:
Caused by: java.lang.IllegalStateException: ...
1
vote
0
answers
78
views
Share Spring Session between Spring MVC and WebFlux apps via Redis
I'm trying to share the HTTP session between a Spring MVC (Servlet-based) application and a Spring WebFlux application using Spring Session backed by Redis.
What I'm trying to achieve:
A user ...
0
votes
0
answers
65
views
Spring Boot REST API returns 404 on POST
I'm building a REST API with Spring Boot and I have a controller for handling tasks. When I try to send a POST request to /tasks using Postman, I get a 404 Method Not Allowed error.
My goal is to send ...
0
votes
1
answer
67
views
Binder.getTarget() is null, can not binding custom key, value using initBinder in Spring 6.x
I am having trouble binding custom key and value map after migrating to 6.x where binder.getTarget() comes out to be null. I debugged and it turnes out binder target is set later point of time. Is ...
0
votes
0
answers
84
views
Spring API Gateway configuration for reactive and non-reactive web sockets
I'm working on a WebSocket proxy microservice in Java, built using the org.java_websocket.* library. It connects to a remote server that streams VNC data. The goal is to allow clients—like noVNC—to ...
0
votes
2
answers
204
views
Spring Boot JWT Auth Fails With "Another algorithm expected, or no matching key(s) found" Despite Matching HS512 Config
I'm building a Spring Boot microservices application where an auth-service generates JWTs and a user-service validates them. I'm consistently getting a 401 Unauthorized error in the user-service when ...
-2
votes
1
answer
366
views
Can i use spring version 6 and above with Java version 8?
I wanted to upgrade my spring version from 5.3.39 to the 6 series. But when I tried to do that, it didn't compile and threw an error.
This is the error that I'm getting:
Failed to execute goal org....
1
vote
1
answer
111
views
Spring Boot 3 upgrade causes NoSuchMethodError for ClientHttpResponse.getStatusCode() — how to support legacy Spring Boot 2 libraries?
I'm upgrading my main application from Spring Boot 2.x to 3.x.
The upgrade is mostly successful, except for a runtime compatibility issue caused by 3rd-party or legacy internal libraries that still ...
-1
votes
1
answer
123
views
(Not a) Bug in spring framework forward
I believe I've uncovered a bug in spring framework with the forward: notation. This is happening with XML based spring applications.
I found this while upgrading my existing spring framework ...
0
votes
1
answer
59
views
No mapping for GET /fed1/webapp/forward:/webapp/message
I am upgrading a project from Spring 3 to Spring 6 using XML based DI.
I have a TranslatingViewResolver that extends AbstractCachingViewResolver. Here is a debug telling how this is operating...
....
2
votes
1
answer
92
views
About spring InterceptorRegistry.addInterceptor() not working
I am currently learning about spring and the concept of beans. I learned that in spring project you can configure in 3 ways -- xml, annotation-based and java-based. I am trying to configure my ...
1
vote
1
answer
175
views
How to use Spring Security in a mixed mvc and webflux app
I have a Spring mvc app with working spring security configuration.
I have a single method that it use WebFlux and require security.
How can i use Spring security inside that method ?
It seams not ...
0
votes
1
answer
76
views
Expired JWT accepted in Spring Boot test
Doesn't Spring check the expiration date of a JWT token, at least in tests?
If so, do I have to do it manually in my code, or is there a way to make Spring do it itself?
<parent>
<...
1
vote
0
answers
157
views
How to configure spirng gateway service/gateway service for spring gRPC?
I am using spring gateway service and eureka discovery server for rest calls. How to configure these services for spring gRPC?
0
votes
1
answer
103
views
Grouping multiple request parameters as single param for @RestController method
Suppose my Swagger-enabled endpoint receives lots of request parameters. I don't want to list all of them one by one. Instead, I want to group them somehow. Preferably, as a DTO: if I declare a Map, ...