150,420 questions
0
votes
1
answer
47
views
Not getting any output from Spring AI MCP server
I am building a skeleton MCP server using Spring AI with the STDIO transport:
pom.xml
<properties>
<java.version>21</java.version>
<spring-ai-starter.version&...
0
votes
1
answer
62
views
Feign multipart file upload intermittently fails with RetryableException: Incomplete output stream
I’m facing an issue while uploading a file between two Spring Boot microservices using OpenFeign.
task-service generates an Excel file
It sends the file to system-service using Feign (multipart/form-...
0
votes
1
answer
66
views
Spring Boot Rest/JPA: Create only 1 parent, when cascade the child creation to parent creation
I need to create a Restfull API with Spring Boot 3.x./ Spring_Data_JPA (Hibernate)
I have this scenario.
I need to create child entities and cascade the persist/merge to the parent entity.
This means:
...
Best practices
1
vote
0
replies
53
views
Configuring Spring Boot 3 (Spring MVC & Spring Security 7) for CORS public access (with credentials)
There are lots of good examples for how to configure Spring Boot for CORS online, but it seems to be very hard to find anything with an intersection of:
Using the APIs in Spring Boot 3 rather than ...
0
votes
0
answers
22
views
Environment variable in Azure App Service fails to disable Quartz in Spring Boot app
I have a Spring Boot app that when I run locally, I can set the SPRING_QUARTZ_AUTO_STARTUP=false variable and it prevents the scheduler from starting.
Doing the same in Azure App Service, and it is ...
0
votes
1
answer
101
views
Connection pool issue in hibernate 6 spring boot 3 [closed]
I recently migrated my application from Spring Boot 2 with Hibernate 5 to Spring Boot 3 with Hibernate 6 in a testing environment. Since the migration, I encounter issues during high load (overload ...
-1
votes
1
answer
71
views
Why do @Async background threads silently fail in Spring Boot on AWS Lambda, while Node.js fire-and-forget works fine?
We have a Spring Boot application deployed on AWS Lambda that makes outbound calls to OCPI partner APIs (EMSP roaming partners). We use @Async for these outbound calls to avoid blocking the main ...
-1
votes
0
answers
65
views
Writing JPA Repository Unit tests [closed]
My learning Spring Boot project consists of the files below. My goal is to write Unit tests that test the UserRepository queries. I've tried different annotations, but never got the test to run. ...
0
votes
0
answers
33
views
New Relic Java recordMetric not showing custom metric data
I'm working with the New Relic Java agent and trying to record a simple custom metric using recordMetric.
My use case is very straightforward: I want to track something like "transactions per ...
1
vote
0
answers
115
views
Spring Boot 4 + Hibernate 7: Cannot persist JsonNode to PostgreSQL jsonb (InvalidDefinitionException)
I am trying to persist a JsonNode field into a PostgreSQL jsonb column using Spring Boot 4 (Hibernate 7).
Entity
import tools.jackson.databind.JsonNode;
import jakarta.persistence.*;
import org....
-2
votes
0
answers
63
views
OpenHTMLToPDF custom TTF fonts not applied (NotoSansArabic). It falls back to default font
I'm generating a PDF using OpenHTMLToPDF (PdfRendererBuilder) in a Spring Boot app, and my custom fonts (ttf) are not being applied. What am I missing for OpenHTMLToPDF to properly apply custom TTF ...
Best practices
1
vote
3
replies
127
views
Why is field injection discouraged in Spring, while it is encouraged in Angular?
In both Spring and Angular, there are two common ways to inject dependencies:
Constructor injection
Field-style injection (@Autowired in Spring, inject() in Angular)
In Spring, constructor injection ...
Advice
4
votes
7
replies
275
views
Why is Spring Boot still used in large-scale systems despite newer backend frameworks?
I am learning backend development using Java and Spring Boot and have built REST APIs using it.
I noticed that newer technologies like Node.js and Go are becoming popular for backend development. ...
Advice
0
votes
0
replies
66
views
Spring Boot , Java
i want to build small chat web application in which chat are end to end encrypted and features of call and video in java spring boot . guide me for build it and what algorithm i can use for it . Give ...
1
vote
1
answer
121
views
How to disable SSL Certificate Validation in Spring RestClient?
A RestClient needs to communicate with HTTPS to a host with self-signed TLS certificate.
I have seen a similar question here on StackOverflow, Disabling SSL Certificate Validation in Spring ...
1
vote
1
answer
134
views
The import org.springframework.boot.autoconfigure.jdbc cannot be resolved
so I've been following this tutorial to build a small website: https://medium.com/@alexandre.therrien3/java-spring-tutorial-the-only-tutorial-you-will-need-to-get-started-vs-code-13413e661db5
I used ...
3
votes
1
answer
217
views
Missing fields during serialization after upgrading Jackson 2 to Jackson 3
I migrated from spring boot 3 to spring boot 4 and I have an issue with the JSON created by Jackson.
The response is like this:
public class MyResponse {
private List<MyData> data;
...
Best practices
0
votes
0
replies
78
views
SpringBoot solution for session metrics
We have noticed that the following Tomcat session metrics are no longer being tracked after adding the org.springframework.session:spring-session-data-redis dependency :
...
0
votes
2
answers
81
views
Logbook 4 not logging trace-id for async response with Spring Boot 4
After migrating from Spring Boot 3.5/Logbook 3.12 to Spring Boot 4/Logbook 4.0.4 I have noticed missing trace-id in logs generated by Logbook for an async HTTP response in context of Spring Web MVC ...
Best practices
3
votes
1
replies
70
views
Best practices for DTO mapping in jOOQ 3.20 + Kotlin Spring boot Web Apps
I recently started using jOOQ, and I absolutely love it. I really appreciate how intuitive it is writing jOOQ code feels exactly like writing raw MySQL
However, as a beginner, I’m struggling to find ...
2
votes
1
answer
70
views
Spring 4 RestTestClient - unable to send Multipart data
I faced an issue when testing a controller endpoint that takes in multipart data. In the test environment the controller throws a missing part exception:
WARN 21080 --- [xxxx-yyyyyyy] [main] .w.s.m.s....
Advice
0
votes
2
replies
49
views
getting 302 error when calling an api services using open feignclient
I have been working on Microservices learning path. Trying to call address service from employee service using Open feign in eureka client program, but I'm encountering this error message:
Request ...
1
vote
1
answer
51
views
How to have a CorsConfigurationSource in an Autoconfiguration in Spring Boot?
I am building a company-specific Spring Boot autoconfiguration. The code looks something like this:
@AutoConfiguration
@AutoConfigureBefore(SecurityAutoConfiguration.class)
@...
2
votes
1
answer
137
views
Spring Boot application moving from Java 17 to Java 25 gives Exception java.lang.NoClassDefFoundError: sun/security/action/GetPropertyAction
I had a Java application in Java 17 which uses the IIOP CORBA protocol for JMS message connection listener and processing those further.
After upgrading from Java 17 to Java25, I get below error ...
Best practices
0
votes
0
replies
67
views
Best approach to generate embeddings for 10K+ documents in Spring Boot + OpenSearch (performance issue)
I am building a search system using Spring Boot and OpenSearch.
Current setup:
Using OpenSearch ingest pipeline with text_embedding processor
Each ZIP file contains 10K+ documents
Bulk indexing is ...
Best practices
0
votes
0
replies
57
views
Evaluating Redisson Distributed Lock (tryLock) to prevent overselling in a Spring Boot E-commerce app
I am building a mid-sized E-commerce web application using Spring Boot, Spring Data JPA (MySQL), and Redis. I need to handle concurrent order creations and prevent overselling (race conditions) when ...
Advice
0
votes
2
replies
35
views
How to create custom login / registration for spring boot webauthn
I would like to use webauthn / passkeys in my spring boot application. I've read quite some tutorials and documentation about spring boot and webauthn but all were just using the default login form ...
0
votes
1
answer
66
views
Spring Boot OAuth2ResourceServer Excluding Paths (Cloudflare Turnstile)
I have a Spring Boot REST API written in Kotlin using Keycloak with Spring Security for authentication and authorization. I want to expose one endpoint publicly but protect it with Cloudflare ...
Advice
0
votes
2
replies
58
views
Why am I getting compilation errors like cannot find symbol getEmail() even though I use Lombok annotations like @Data?
This usually happens because Lombok generates getters/setters at compile time. Your IDE (VS Code, IntelliJ) can see them while running the app, but Maven doesn’t automatically run Lombok’s annotation ...
Best practices
0
votes
1
replies
55
views
Best approach to implement cascading filters (45 columns, up to 10k values each) in React + Spring Boot with SQL backend
I have a React UI with a Spring Boot backend that retrieves data from a SQL database.
The screen contains around 45 filter columns, where filters work in a cascading way. For example:
Selecting a ...
1
vote
1
answer
56
views
Backslash and Placeholder in application.yml
Given is a Spring Boot application.yml file.
host: example.com
unc-path: \\${host}\share
If unc-path is printed, the output is \${host}\share.
I expect the placeholder ${host} to be resolved. The ...
0
votes
2
answers
137
views
DockerHub: Unable to open JDBC Connection for DDL execution [Could not create connection to database server]
I am learning SpringBoot and I'm making an application that need to connect to a Springboot API. I don't have problem when running my API locally, but when I use Docker it fails to find the database.
...
-1
votes
0
answers
89
views
ID Token doesn't contain SID claim if I have multiple instance of Spring Authorization Server
I have 2 instances of Spring Authorization Server (SAS), running locally behind nginx. My SAS is using:
Spring Session JDBC to save session to oracle db
JdbcOauth2AuthorizationService to save ...
Best practices
1
vote
5
replies
126
views
Understanding using Spring Boot in IntellIJ with layered architecture
I am studing Full Stack development. so far, I don't have an idea what is the content of files in IntellIJ and how it helps my project. do I follow tutorials or ChatGPT to write and understand the ...
0
votes
0
answers
44
views
I do not receive messages from local Azure Event Hubs
I think I am sending messages to local Azure Event Hubs emulator successfully because I do not see any errors in the console. But I do not receive any messages in the consumer.
I have the following ...
Tooling
0
votes
1
replies
90
views
What is best choice for java spring- boot deployment for beginners
What is best choice java spring- boot deployment. AWS ELASTIC Beanstalk or Render. Frontend is in Angular ,Vercel. The problem is aws give http and Vercel have https. And the beginners don't want to ...
Best practices
2
votes
2
replies
127
views
How to make a bean initialize before DataSource without excluding auto‑configuration
I have a Spring Boot application that relies on the default DataSourceAutoConfiguration to create my DataSource bean. I also have a custom bean that must be fully initialized before the DataSource ...
0
votes
1
answer
132
views
How to correctly map nested OpenID Connect (OIDC) claims to Spring Security 6 Authorities?
I am migrating a Spring Boot 3.2 application from a custom Auth server to Keycloak. In my previous setup, I used a flat list of roles in the JWT. However, Keycloak nests roles inside a realm_access ...
0
votes
0
answers
122
views
Include a bean generated via an annotation to an autoconfiguration
I am working on a project with multiple Spring Boot projects. I have a one "common" project that is a dependency used by other projects. Inside that common project, I have created an @...
Best practices
1
vote
4
replies
224
views
How to customize ObjectMapper in Spring Boot 4 without losing existing settings?
I am using Spring Boot 4.
Before (in Spring Boot 3), I created my own ObjectMapper bean like this :
@Bean
@Primary
public ObjectMapper objectMapper(Jackson2ObjectMapperBuilder builder) {
...
0
votes
1
answer
54
views
Unable to retrieve the correct message in @GlobalHandler
@Component
public class CustomAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Autowired
@Qualifier("handlerExceptionResolver")
private HandlerExceptionResolver ...
0
votes
0
answers
58
views
Spring unable to get preferred_username from Entra user request
Spring Boot is unable to find a preferred_username attribute when authenticating against Entra.
I have registered an application in our Entra tenant as follows:
Optional Claim - add 'acct' and '...
1
vote
1
answer
121
views
How to import Mockk dependency in Kotlin class
I just downloaded a demo project from start.spring.io
In pom.xml I changed the kotlin version to 2.2.0 and added `io.mockk` dependency.
But in the code I am not able to import it. Even though I see ...
Tooling
1
vote
4
replies
68
views
SpringBoot & Docker desktop & IntelliJ Idea
I have simple example Spring Boot Web projcet. And I have Docker desktop running on my Mac (silicon).
I would like to run my spring web app on my local docker.
And I have Dockerfile in my Spring boot ...
2
votes
2
answers
217
views
How to define ObjectMapper based on autoconfiguration?
In my new application, I'm using Spring Boot 4.
I noticed that ObjectMapper is now under
import tools.jackson.databind.ObjectMapper;
so I'd like to understand how to modify this bean that I was using ...
0
votes
0
answers
41
views
Kamon working locally, but not in test environment with the same properties
I want to add Kamon metrics for Akka to my Spring service, for that i included the following dependencies:
<dependency>
<groupId>io.kamon</groupId>
...
Best practices
0
votes
1
replies
54
views
Spring boot redis queue
I have implemented redis for otp purposes, same redis used for triggering emails for another application using redis queue which deployed in same tomcat server. Now when I redeploy my otp service, ...
3
votes
0
answers
94
views
How to connect GridDB Cloud to a Java Spring Boot application?
I’m trying to integrate GridDB Cloud with a Spring Boot Java application, but I’m not sure about the correct setup process.
I followed the documentation and added the GridDB Java client library to my ...
2
votes
0
answers
101
views
Hibernate LEFT JOIN FETCH returns empty PersistentBag in Spring @Transactional integration test
Hibernate LEFT JOIN FETCH returns empty PersistentBag in Spring @Transactional integration test
Problem
When using @Transactional on a Spring Boot integration test class, Hibernate's
LEFT JOIN FETCH ...
-1
votes
0
answers
126
views
VectorStore.accept() exhausts HikariCP connection pool when batch ingesting with virtual threads
I am building a RAG (Retrieval-Augmented Generation) pipeline using Spring Boot 3.5, Spring AI 1.1, and pgvector. I am using Java 21 virtual threads to speed up the document ingestion process.
When I ...