150,224 questions
Score of -1
0 answers
112 views
Encountering a compilation error in the generated hash() related to additionalProperties when using the OpenApi Generator Plugin with SpringBoot [closed]
We are encountering a compilation error in the generated hash() method related to additionalProperties when using the OpenAPI Maven Generator plugin with Spring Boot 4. Could you please help us ...
Score of -1
0 answers
115 views
Spring Boot endpoint that returns 202 with a jobId and runs a long sync task in the background
I'm working on a university project for a water billing office. The office has a legacy system with a MySQL database that we are not allowed to modify. As part of a new feature, we created a separate ...
Score of 0
0 answers
115 views
RAG with Spring AI and Llama 3.2 answers some queries but refuses semantically similar ones [closed]
I'm building a RAG pipeline with Spring Boot 3.2, Spring AI 1.0.0, Ollama running Llama 3.2:3b, and pgvector as the vector store. The pipeline retrieves documents from pgvector and injects them into ...
Score of -2
0 answers
76 views
Connection refused when injecting ChatClient with Ollama and Llama 3.2 in Spring Boot
I'm building a RAG pipeline with Spring Boot 3.2, Spring AI 1.0.0, and a local Llama 3.2 model running on Ollama. When I start the application and try to use ChatClient, I get the following error: org....
Score of -7
0 answers
131 views
Using @AllArgsConstructor and @NoArgsConstructor Lombok annotations for Java Spring Boot - Error "constructor cannot be applied to given types" [closed]
I'm building an app with Spring Boot, using Lombok and its annotations @AllArgsConstructor and @NoArgsConstructor. When applying those annotations, my build either fails (when already letting code on ...
Score of -2
1 answer
96 views
spring.test.database.replace=none does not work as global equivalent of @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
In our Spring Boot 4.1.1 application, all our @SpringBootTest JUnit tests use custom-defined databases with details in the application-test.yml. To make them work we have to disable the attempts to ...
Score of 1
1 answer
93 views
How to preserve custom fields from an OAuth2 token response and use them in Spring Authorization Server JWT generation?
I am integrating a third-party OAuth2 Authorization Code provider with a Spring Security + Spring Authorization Server based application.
The provider supports only OAuth2 Authorization Code Flow and ...
Score of 2
1 answer
118 views
How to declare quorum queues with RabbitAmqpAdmin in Spring AMQP 1.0?
I am implementing a messaging solution using Spring Boot and RabbitMQ where our primary requirement is high availability and message safety. Because of this, our goal is to ensure that all queues are ...
Score of 1
1 answer
138 views
Spring Security: recommended way to handle per-user permissions with JWT without hitting the DB twice per request?
I'm using Spring Boot 3 / Spring Security 6 with JPA. My JWT contains only the user's email. On every request, my filter loads the User entity from the DB and puts it in the
SecurityContext:
String ...
Score of 1
1 answer
216 views
Existing JAXBElement leads to ClassNotFound/DefNotFound on Java 11 [duplicate]
(This question is a bit of a special case of other, but similar, questions. As the accepted answer shows, the solution here is related to configuration of the boot-gradle task/plugin, not a question ...
Score of 3
3 answers
246 views
What should I do when a REST request times out but the operation may still be running?
My Spring Boot service calls another API to start an operation that can take a few minutes:
My service -> POST /operations -> Provider
Normally the provider returns an operationId which I store ...
Score of 0
1 answer
97 views
Hibernate 7 join ManyToOne including null values and multiple keys
My project is build on Springboot 4, with JpaRepositories on Hibernate 7
I need to create a REST endpoint that will return a structure that is modeled like this on OpenAPI:
openapi: 3.2.0
info:
...
Score of 2
2 answers
108 views
How to log reason Spring Boot tests are not using cached application context?
I have several JUnit 5 integration tests extending one base class. The base declares @SpringBootTest, but Spring appears to start multiple application contexts.
@SpringBootTest(classes = ...
Score of -4
1 answer
159 views
Modeling a hierarchical staff role system alongside a plain customer role: same User entity or split into Customer/Employee? [closed]
I'm building an e-commerce backend in Spring Boot with Spring Security. Currently I have a single User entity that implements UserDetails, used for both customers and staff (admins/managers/employees),...
Score of 2
2 answers
189 views
How should I handle retries when a Spring Boot service provisions a PostgreSQL cluster through a cloud API?
I'm working on a Spring Boot service that provisions PostgreSQL clusters through a cloud provider's API.
The provider's API is asynchronous, so my endpoint roughly works like this:
POST /clusters
...