150,226 questions
Score of -5
0 answers
44 views
JPA save inside rabbitmq listener
I am trying to save an entity consumed inside a queue using rabbit mq. I have encountered
some problems.
First of all : The consumed event will give me an entity which already has an id. My user ...
Score of -1
0 answers
100 views
Why is spring.config.import from application.yml not overridden by profile-specific configuration?
I'm using Spring Boot 2.7 with Spring Cloud Vault and trying to understand how spring.config.import behaves when defined in profile-specific configuration files.
My goal is to import different Vault ...
Score of -1
0 answers
123 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
119 views
Spring Boot endpoint that returns 202 with a jobId and runs a long sync task in the background [closed]
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 -1
0 answers
124 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
81 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
133 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
97 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
97 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
120 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
217 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
249 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
113 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 = ...