150,555
questions
0
votes
0
answers
7
views
Is it possible to configure a converter for spring's HttpInterface?
Let's say I'm given the below endpoint:
GET /hello/{id}?idType={idType}
where the allowed values of idType are ["loginId", "contactId"]
I have to consume this service using:
@...
0
votes
0
answers
9
views
how to insert in batch mode 2 tables with manytomany relationship with springboot?
I Have 2 tables with a manytomany relationship.
What is done so far, i use jpa (repositories) to insert list of this A,B and A_B tables.
The problem is that using jpa for a huge set of data is not ...
0
votes
0
answers
13
views
How to write a JPA criteria query with dynamic duration in where clause?
I'm trying to translate the following SQL query into a JPA Criteria Query using CriteriaBuilder and Specifications.
SELECT *
FROM activity
WHERE date_start + duration * interval '1 minute' > ...
0
votes
0
answers
10
views
Upgrade to Spring Boot 3 and in dependency heck. Can someone explain "omitted for duplicate" and "version managed from" in dep:tree -Dverbose
I've been fighting versions in maven all week, and I'm getting desperate.
I finally got it to compile, but there are somehow subtle differences that show up at runtime. Specifically for the wiremock ...
0
votes
1
answer
12
views
MapStruct NullValuePropertyMappingStrategy.IGNORE resets empty booleans to false?
Using the documentation for MapStruct , I see that the option for ignoring null values when updating from a source to a target is available using nullValuePropertyMappingStrategy = ...
0
votes
1
answer
33
views
Cannot find symbol with Lombok
Basically I'm trying to create an API using Spring Boot, however I'm with some problems with lombok annotations I guess.
This is my domain (I can use @Data, but it shows the same error):
@Entity
@...
-6
votes
1
answer
26
views
Spring Boot Error while building the application
I'm getting the below error while building spring boot and it states that error creating the beans. Can you guide me through this on how we can resolve the error?
024-12-07T01:14:52.917+05:30 INFO ...
0
votes
1
answer
12
views
How to add a header and/or a footer to a file using SFTP Outbound Adapter?
I am consuming messages from Kafka and writing those to a file using SFTP Outbound Adapter on a remote file server. The application will run multi-instance in the cloud environment.
I am using leader ...
-1
votes
1
answer
14
views
SpringBoot get the request.remoteAddress() without org.springframework.web.servlet.function.ServerRequest
I am trying to get the request.remoteAddress() in a SpringBoot Controller class.
However, the controllers currently take the body as follow:
@RestController
public class HelloController {
@...
0
votes
0
answers
10
views
Is Spring Web Socket Buffer Size Limit per connection
I'm working on a project where we are evaluating how much data load a spring service will potentially handle via web socket and how much buffer size should be set.
I understand when the web socket ...
-1
votes
1
answer
15
views
Spring Boot - How to display app name, version, build time etc in actuator /info endpoint
I have seen numerous articles and posts on this topic and they seem all to do it differently and in many cases the suggested solution was unclear or was not working. Some of the solutions worked but ...
0
votes
1
answer
16
views
Spring Boot 3.35 Basic Authentication with AuditorAware and Custom Endpoint - Angular 18 Front End - Not Working
Spring Boot 3.35 Basic Authentication with AuditorAware works fine but does work with a custom endpoint
With these two modules, using the default Spring Boot Login, I am able to add or edit a record ...
0
votes
0
answers
10
views
Add Tenant Filter to Spring authorization Server
I want to add a TenantIdentificationFilter in the Spring Authorization Server.
I am trying to configure it as mentioned in this post.
This however is producing the error Cannot resolve symbol '...
0
votes
1
answer
31
views
(Spring Boot (DATA JPA)) How can I ensure that each table can have multiple records with the same id without causing overwriting existing records?
I am currently creating a POST endpoint that sends a request body containing an array of strings and other variables. I am trying to save this data into two different tables, both referencing the same ...
0
votes
0
answers
7
views
Getting refresh_token null in springboot3.3 using oauth2 google
I am using Spring boot 3.3 with below configuration
Application.yaml :-----
spring:
security:
oauth2:
client:
registration:
google:
client-id: xxxx
client-secret: xx
scope: profile, email, openid
...
0
votes
0
answers
13
views
PrimeFaces JS resources have no content type header since Jakarta migration of Spring Boot JSF app
I have started to migrate from Javax to Jakarta namespace in my application, I have replaced all Javax imports with Jakarta imports through out my code. I have following dependencies
spring boot 3
...
0
votes
1
answer
18
views
how should I test @authentificationprincipal?
I got @PostMapping("/login")
public String postLogin(@AuthenticationPrincipal CustomUserDetails userDetails) {
authService.auth(userDetails.getId());
return "redirect:/main";
} ...
0
votes
0
answers
13
views
Unable to build native image with GraalVM for Spring Boot 2.7.14
The jar was running successfully and image was also generated successfully with mvn -Pnative clean package. After generating the image, I try to run using ./native-image-name.
I get the following ...
0
votes
0
answers
28
views
Spring Boot 3.4.0 Read timed out using Http interface
I was using the latest version Spring Boot 3.3.6 with HTTP interface like following:
@Bean
public RestRepositoryUser restRepositoryUser(@NonNull @Value("${gsrest.url}") String ...
0
votes
0
answers
10
views
Remote Partitioning in Spring Batch - Job completion for small number of records can't de done until Job completes for large number of records
I am trying Spring Batch with remote partitioning [ master-salve approach].
I have one master step which sends records to worker nodes via KAFKA.
All was working fine until parallel job executions ...
0
votes
1
answer
21
views
What is the most efficient way to update a large list of objects using Spring and Hibernate?
I’m starting a small project using Java Spring Boot and Hibernate. It’s a simple game app involving a deck of cards. A deck can contain anywhere from a few hundred to a thousand cards. Each card is a ...
0
votes
0
answers
15
views
Role Based Access Control With Auth0 and SpringBoot
I have a problem with assigning role-based access control on my SpringBoot application. I created a new API in Auth0 and assigned permissions to the API and enabled RBAC in the API. And authorized the ...
0
votes
0
answers
11
views
Spring Boot 3.4.0: ConverterNotFoundException for SpEL property spring.cloud.stream.rabbit.default.producer.routing-key-expression
After upgrading my application from Spring Boot 3.3.X to 3.4.0 (Spring Cloud 2024.0.0) I get the following Exception at startup:
Failed to bind properties under 'spring.cloud.stream.rabbit.default....
0
votes
1
answer
18
views
Spring deserialize List<Resource>
I have a springboot project with openApi for generate specification, i try to make an endpoint which receive many files but i have a spring error.
JSON parse error: Cannot deserialize value of type `...
0
votes
1
answer
22
views
Java Spring: Unsupported Media Type with x-www-form-urlencoded body
I'm working on a REST API using Spring and I'm trying to implement a POST endpoint that receives x-www-form-urlencoded data in it's body. This is my controller method so far:
@PostMapping(value = &...
0
votes
0
answers
30
views
How can I implement SecurityContextHolder in a generic base service while adhering to SOLID principles? [closed]
I have an abstract base service that includes basic CRUD operations. However, there’s a situation where, for example, when saving a Post entity, I also need to save the User information who created ...
-1
votes
0
answers
21
views
Spring Boot cronjob using class program
Now the client wants me to run a cronjob without using the default spring boot cronjob feature, so I cannot use the @EnableScheduling.
Inside this project I am using Spring Boot as the backend, and it ...
0
votes
1
answer
22
views
Query parameters of GET request are cut up to the last value if Spring Boot app deployed as AWS lambda function
I'm sending the following request to Spring Boot application deployed as AWS lambda function:
GET https://my-dev-host.com/fdx/v6/accounts?accountIds=confUser_1&accountIds=confUser_2&accountIds=...
2
votes
0
answers
47
views
How to define a UUID identity column that satisfies both MySQL 8.4 and H2
I'm trying to implement a table that uses UUID instead of long as its identity column.
The long id implementation works perfectly, including end-to-end Spring MVC tests:
@Getter
@Setter
@Entity
@Table(...
0
votes
0
answers
26
views
How to create a maven dependency and use it in Spring boot
I want to create a maven dependency Spring boot and use it in other project. But I have compile error...
[INFO] [1m--- [0;32mcompiler:3.13.0:compile[m [1m(default-compile)[m @ [36msso[0;1m ---[m
[INFO]...
0
votes
0
answers
14
views
How to pass a list of parameters with $regex conditions in a Spring Data MongoDB query?
I'm having an issue with a MongoDB query through a repository, as shown below. I want to modify the query so that instead of passing parameters one by one, I can pass a list of parameters. Everything ...
0
votes
0
answers
28
views
Spring Security context is thread session?
When I was reviewing the debugging project, the previous HTTP request set Spring Security context and redirect, while the next redirected request can directly obtain authentication. In other modules, ...
0
votes
0
answers
26
views
why Spring Security always throw an 403 forbidden?
I try to build a project using spring security and saw tutorial online and documentation but it always throw 403 forbidden when i tested it using postman, any idea how to fix it?
here is my security ...
0
votes
1
answer
25
views
Spring boot Bcrypt Password in application.properties
I want to store a BCrypt-hashed password in application.properties for datasource.password and establish a MySQL database connection. Is this feasible? Is there any way to configure Spring so that I ...
-1
votes
2
answers
34
views
Lombok Annotations Not Working in Spring Boot Project (Java 21)
I am working on a Spring Boot project using Lombok to generate boilerplate code such as getters, setters, and constructors. Despite having the correct Lombok dependency in the pom.xml, methods like ...
0
votes
0
answers
27
views
Getting error after changing spring-boot version to 3.4.0 from 3.1.4
There was an error in the forked process
Cannot instantiate class xxxxx.api.controller.AdminControllerTest
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging....
0
votes
1
answer
20
views
is it possible to give columnName in value parameter in spring data jpa native query
I have spring jpa repository code something like below, and the fields id, std, email are coming from the frontend based on the filter selected by user.
@Query(value = "select * from dbo.student ...
0
votes
0
answers
21
views
Position for Filter after AuthorizationServerContextFilter in Spring Authorization server
I want to add a filter after the AuthorizationServerContextFilter.class in Spring Authorization server.
I cannot add it directly after this class as it is not public.
Which is another possible class ...
0
votes
0
answers
19
views
Multiple SpringBoot @RequestHeader annotation for only one Map<String,String> headers
SringBoot has this famous construct to extract all request headers:
@RestController
public class AllHeaderController {
@GetMapping("/print-all-headers")
public void getAllheaders(@...
0
votes
0
answers
13
views
Generate AuthnRequestsSigned and WantAssertionsSigned in metadata spring security saml2 v6.4.1
I have to create the integration of the application I'm developping to an existent SSO which I don't controll it.
In the last project, i was using
<parent>
<groupId>org.springframework....
1
vote
0
answers
32
views
SpringBoot 3.4 with virtual thread enabled, but getting sequential execution
In my Spring Boot 3.4 and Java 21 based application, I have enabled virtual threads via:
spring.threads.virtual.enabled=true
I am using Spring Boot 3.4:
<groupId>org.springframework.boot</...
-1
votes
0
answers
19
views
In Spring Security, exceptions are passed forwards along the filter chain in a forward direction or backwards?
@Component
public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse
response, ...
0
votes
0
answers
22
views
Spring Boot Error: Consider defining a bean of type
Spring Boot 3.0.0
Trying to run my application, but I'm getting the error:
Description:
Parameter 0 of constructor in com.example.pcoshealthtracker.controller.RegistrationController required a bean of ...
0
votes
0
answers
35
views
java.lang.IllegalArgumentException: null in WebSphere when Payload Size Increases
I'm encountering an issue in my Spring Boot application hosted on WebSphere. When the payload size increases, the application throws the following exception:
java.lang.IllegalArgumentException: null
...
0
votes
0
answers
20
views
Spring-Context upgrade for version 6.1.15 failing with java.lang.NoSuchMethodError for WebAsyncManager.isMultipartRequestParsed()
Issue is with the spring-context WebAsyncManager which is not able to find the method
c.f.h.l.w.s.e.UniformExceptionResolver : java.lang.NoSuchMethodError: 'boolean org.springframework.web.context....
0
votes
0
answers
6
views
Spring Boot MQTT setup with RendezvousChannel and multithreaded downstream execution
I am trying to connect two applications via MQTT while making sure there is no data lost during execution. For this reason, I decided to use a RendezvousChannel because an active MQTT-Broker is set up ...
0
votes
1
answer
22
views
Is there way to have polymorphic behaviour for convertors from DTO to model?
I have endpoint which accepts BaseDto:
@JsonTypeInfo(...)
@JsonSubTypes({
@JsonSubTypes.Type(...),
...
})
@RequestMapping(
method = RequestMethod.POST,
value = "/path",
...
0
votes
0
answers
9
views
Datasource Micrometer not working with opentelemetry zero-code instrumentation
I am using the zero-code instrumentation Java agent in order to export traces from my Spring Boot app to Jager in otlp format. So far so good, but i need more than the autoconfiguration provided by ...
0
votes
0
answers
15
views
RabbitMQ Queue assigns job to different server
I am making a project using SpringBoot, RabbitMQ, Elastic Search and k8s. My project currently consists of 2 parts. While my 1st project performs the process of saving my logs to rabbitMQ, in my 2nd ...
1
vote
0
answers
25
views
Spring 3.4.0 Upgrade: Multiple Bean Definition Issue with Generic Repository in Abstract Service
After upgrading to Spring 3.4.0, I encountered a bean injection issue in a generic abstract service class. Here's the relevant code:
Repository Interface:
@NoRepositoryBean
public interface ...