Category "spring-boot"

Get body as raw string from ServerWebExchange/ServerHttpRequest

I need to get the request body as a raw JSON string in my controller. I'm using Spring WebFlux. If I could change @PostMapper function signature, it will be so

Why do not work @Validated in spring boot 2.6.2

I have in my pom file: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validati

How to stop listening in a Spring Kafka consumer?

I use Spring for Apache Kafka. I'd like to stop listening to my topic and wait to escape OOM. How can I do it?

Mapstruct - How to convert a DTO String parameter to an Entity object?

I'm new to Mapstruct and I'm trying to understand it properly. What I want to achieve is converting from a DTO String parameter (carModel) to his Entity, retrie

NullPointerException when upgrading Spring Boot to version 2.6.2

I upgraded by Spring Boot version from 2.5.4 to 2.6.2. Now my app fails at startup because of this error - see below. Any ideas how to fix it? Error starting Ap

How to add classpath resource in application.yml file

With spring-boot, in case of application.properties file there is provision to specify classpath in value. app.templates = classpath:app\mock-templates How to

How to add classpath resource in application.yml file

With spring-boot, in case of application.properties file there is provision to specify classpath in value. app.templates = classpath:app\mock-templates How to

Derive tenant id for signed in user in OAuth2 based multi-tenant Spring Boot application using Spring Security

I am working on a Spring Boot B2B application, where I would like to onboard a considerable number of tenants. Each of the tenants has its own authentication pr

Springboot + JWT +OAuth2 + AngularJS Stateless session

I am trying various Java Spring based security implementations as follows 1. JWT Authentication User access / Springboot identifies as protected resource and

Mybatis, pass muliple list as parametres

String loadCandies(@Param("id") String id, @Param("varietyList") List varietyList, @Param("errorCode") List errorCodes) How can I achieve this in mybatis xml, a

Why does my th:each not work in my div? Thymleaf

I'm trying to th:text in my div but it doesnt seem to work I tried doing it with a table and i get the data i need but when i put it in a div it doesnt work

SessionStorage is Null

First of all I'm saving a user in SessionStorage in React. The problem is that I'm trying to make a filter that validates some data in the user saved in Session

Mybatis foreach mapper item exception

I am using foreach for SELECT IN clause. Item has not been found by mapper. Here is part of exception. org.mybatis.spring.MyBatisSystemException: nested excepti

Spring batch - conditional step flow for Chunk model

I have two step where, step 2 should be skipped if the step 1 processor doesn't returned any item after filtration. I see ItemListenerSupport can be extended an

How to get login and pass from basic auth in spring boot

I'm writing REST app with spring boot. I wanted to implement authentication througn basic auth with login and password manually (without using of the spring sec

RESTful web service: How can I take this data without printing out the other

I want to just take the data from menSize and its price but it keep printing out the womenSize eventhought it doesn't add anything in it. Do I need to seperate

Global exception handling in spring webflux during tests

I'm developing a service with spring webflux. I implemented exception handling using @ControllerAdvice. It works pretty well, but when I run integration tests i

Spring cloud Netflix-Hystrix gradle dependency not allowing spring boot application to start

I have built simple microservice application using Spring-Boot and Eureka server. Now, I want to add fault-tolerance in case any of service registered in Eureka

Bi-directional relation in hibernate is failing to be cascadelly saved

I am using a Spring-Boot (2.3.3) application with Hibernate (5.4.20) and JPA repository on MySql DB, and I have a Bi-directional relationship between an entity:

Java @requestBody doesn't work, dto empty

For some reason java can't map DTO with requestBody and all values are default ones, as for request it works, with payload for ex. "{"productId":1,"commitment":