Category "spring"

How do I share an object between two or more WebSocket controllers in Spring Boot?

I have two controllers, namely ControllerA and ControllerB. In ControllerA I have an object (a HashMap) which maps principal names for connected users to their

Spring Batch JPA Bulk Insert eats performance when using GenerationType.IDENTITY

I am using Spring Boot and Spring Batch and JPA to load data from One database into another. In a single batch Job I've created 10 steps to run steps in sequenc

Spring native query with GROUP BY and ORDER BY also pagination

What if I have my native query (with PostgreSQL) in a more "complex" way, which I need to GROUP the data in order to apply an ORDER BY clause? Well, doing so wi

Looking for something similar to Laravel Livewire for Spring Boot

I am looking to use Spring Boot for my next project and I am unable to find something that offers similar functionality to Laravel Livewire, does anybody know i

javax.validation.ValidationException Error

Error: Caused by: javax.validation.ValidationException: HV000183: Unable to initialize 'javax.el.ExpressionFactory'. Check that you have the EL dependencies on

How do I mock a static void method (not with doNothing or invocation -> null) using Mockito.mockedStatic?

I have the following classes class FileDownloader { public static void downloadFile(String repoUrl, String filename) throws IOException { // Downloa

How to search from spring cache using where condition?

In the spring boot application let the entity is as follows public class Employee{ private String location; private String name; private String lastNam

Getting All Object attribut names reursively

is there any way to get all attribute names of an object Company recursively: ExpectedOutput id, age, address {street, zipCode}, employee {firstName, LastName,

When downloading a file using ResponseEntity in Spring, byte breaks in reaction

This is a method of downloading files from Spring to ResponseEntity. When you download it, the byte breaks and comes out. If you use tag a, you can download the

Gateway-service. 500 Server Error for HTTP GET "/"

I'm having some troubles related to the gateway service in Spring boot. I have the following .yml #spring.profiles.active: local server: port: 80 #ssl:

Add custom labels to default spring boot actuator metrics

I'm currently working on a Spring boot (webflux) project where we have exposed metrics of our application on /actuator/prometheus endpoint using spring boot act

Spring Web Flow: add view state information to URL

I'm using spring web flow 2.5.1.RELEASE. I need to show info about the current view state in the URL (I need it for customer journey tracking with google analy

How to use Autowired in BeforeStep cucumber step definition

I'm getting NullPointerException when I use @Autowired in the @BeforeStep cucumber method in my step definition. What I'm doing wrong here? Please find my code

Unable to logout using spring security OidcClientInitiatedLogoutSuccessHandler from ADFS server

When I do logout, It should redirect to end_session_endpoint of ADFS which is "https://fed04.fcagroup.com/adfs/oauth2/logout" however its redirecting back to ho

hasAnyRole() not working with Spring Security 5.4.6

I have changed my spring framework version from 4.1.4.RELEASE to 5.3.6 and spring security version from 3.2.5.RELEASE to 5.4.6. I'm facing problem when using &l

GraphQL + Springboot + Http Headers

I'm using these graphql dependencies: "com.graphql-java-kickstart:graphql-spring-boot-starter:12.0.0", "com.graphql-java-kickstart:graphql-java-tools:12

Unable to configure Spring Cloud Consul for specific profiles

I'm trying to configure spring cloud consul for a specific profile but when I try to run the application I get the following error: ***************************

Mock a complex api call

I have some problemi understanding spring @MockBean in complex api call: serviceCommunication.callAPI(HttpMethod.POST, Servi

How to call a stored procedure in Spring Boot?

A query for a stored procedure for multiple delete yield an error message shown way below. CREATE OR REPLACE PROCEDURE delete_dim_page(_page_id bigint) LANGUAG

RabbitMQ doesn't show me the queues and exchange created in my Spring consumer and publisher apps

I am trying to create a publisher and consumer apps in spring using RabbitMQ. Every thing works fine and when the publisher sends a message, the consumer receiv