Category "spring"

Jasper Library download forbidden when running maven: mvn package

I am downloading all libraries I need for my spring project in Intellij Idea. I am using maven: mvn package. All libraries succeeded, except for one that is for

Integration testing using @SpringBootTest is not picking auto-configuration of library configured using spring.factories

We have a library ,in order to auto-configure the library we use spring.factories file under(src/main/resources/META-INF) which provides classes to auto-configu

Set different timezone for each deployable in tomcat

I have a web project which creates 2 separate deployables(.war files). I deployed both in single tomcat, and when I change the JVM timezone in a beanFactoryPost

How to deserialize BigDecimal value received from kafka broker through debezium CDC mechanism?

I have a couple of microservices developed using spring boot and each has its own Postgres database. These microservices exchange data with a CDC mechanism prov

No qualifying bean of type 'javax.persistence.EntityManagerFactory' available whike upgrading SpringBoot from 2.1.18.RELEASE to 2.6.2

No qualifying bean of type 'javax.persistence.EntityManagerFactory' available whike upgrading SpringBoot from 2.1.18.RELEASE to 2.6.2 @ConditionalOnProperty("sp

Jasypt not decrypting properties during junit testing, but works fine when spring boot app runs

I have a Spring Boot application with a few properties encrypted with Jasypt, and I provide the secret key with the following VM option: -Djasypt.encryptor.pass

Add a object with custom annotation in springboot

I need to add an object like @Slf4j's "log" in a service class, for example: @Slf4j @Service public class MyService { public void anyMethod() { log

How to mock Spring WebFlux WebClient?

We wrote a small Spring Boot REST application, which performs a REST request on another REST endpoint. @RequestMapping("/api/v1") @SpringBootApplication @RestC

Spring data cassandra (v3.3.1): how to add codec?

I use spring-data-cassandra:3.3.1 and try to apply TimestampCodec. Documentation says that all codecs should be added through CodecRegistry, but says nothing ab

How to output/serialize correct YearMonth value to display on form using Spring annotation?

I have the following variable in my POJO class being used to load the correct saved data into a form: @JsonDeserialize(using=YearMonthDeserializer.class) @JsonS

Spring Cloud Stream RabbitMQ wait for publisher confirms

I am using Spring Cloud Stream with the RabbitMQ binder. I use the StreamBridge to send messages to a destination. I want to send a message with StreamBridge an

Spring Data MongoDb - how to use "findAll" method which return only valid documents

I use Spring data mongo as ORM for accessing to my MongoDb. I need to read a MongoDb collection containing documents that I don't manage content and its validit

Accessing application property in Spring boot application from MapStruct mapper

I want to access basic-info.expiration from application.yml a Spring boot application. application.yml basic-info: expiration: 6 UserMapper.java @Mapper(comp

Getting this error while calling a hardcoded insert query in myBatis

10:59:35,454 ERROR [stderr] (pool-6-thread-1) org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

How to write a unit test for spring specification?

I created a builder class which construct Specifications object. It is used for creating queries for JpaSpecificationExecutor. The builder is used, because I ha

Unable to register MBean

I am writing integration tests for a spring-boot application, and I am using a base test class for common methods and all the other common stuff. Something like

Combine Pagination of Two Different Entities With different size

I'm working on a problem where i have to do pagination of two data lists. ex. psudo code int recordsPerPage = 100; // this is dynamic int currentPage = 1; // th

spring reactive retry with exponential backoff conditionally

Using spring reactive WebClient, I consume an API and in case of response with 500 status I need to retry with exponential backoff. But in Mono class, I don't s

How to get relationship data with spring boot rest api?

I'm building a REST API with Spring Boot to retrieve boat information. I'm using Spring Data Rest and Spring Data JPA. When I get the data from the API, I don't

Return id of Many-To-One relation in Java Spring rest api

I have 2 models: Student and Teacher. Teacher has One-To-Many relation with Student, Student has Many-To-One with teacher. I want to build API what gonna have i