Category "spring-boot"

Distribute cache between Pods in Kubernetes with Hazelcast in Spring boot application

I have a Spring boot application with Hibernate L2 cache enabled. I integrated Hazelcast as cache provider for Hibernate. My application runs on Kubernetes and

Why my CORS filters don't work? Spring Boot

My backend setup has big issues with CORS on REST controllers. I tried to apply all sorts of filters, none of them work. This is my current CORS filter implemen

How to disable auto login redirect in Spring Boot Keycloak Adapter

I am writing an API in Spring Boot that I want to secure using Keycloak. After doing some setting up, I managed to get the keycloak adapter to work. While I was

joinColumns in Hibernate for standard relations?

In the following example, there are 3 entities which have relations e.g. @ManyToMany, @OneToMany and @ManyToOne: Student: @Entity @Data public class Student {

Citrus httpServer & httpClient tests

I'm using Citrus for perform integration tests based on http requests. The test should perform steps as follows: Sending a POST http request to external service

org.graalvm.polyglot.PolyglotException: ReferenceError: document is not defined

I am using Spring boot 2.4.4, JDK 1.8, and created ScriptEngine as shown. Page loaded perfectly for the first time but the second time it throws the exception

Spring Api-Gateway: (M1) java.lang.UnsatisfiedLinkError: no netty_resolver_dns_native_macos_aarch_64

Just to clearify this only occurs on M1 Mac, the intel version doesn't seem to have this problem. JDK 17 openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Env

How to update a JSON array in a Java

I have a JSON file name abc.json Once I opened this file there is data like in square brackets. [{ "1" : "xxx", "20" : "ppp", "25" : "hhh" }] Here in this keys

Conflicting enum values java

I have 2 enums defined as below in 2 separate files: MyErrorCodes.java @Getter public enum MyErrorCodes implements ErrorCode { ERROR1(90, 1, 01), ERROR2

Is it possible that the changes made by a transactional method are visible in database before the transactional method ends

Two Spring boot (spring data jpa) Application A1 and Aplication A2 both read/write to a table named T1. T1 -> ID, data1, isDeleted columns My requirement is

How to use Mono<Boolean> in if else conditional statement?

I am using Flux<Document> in reactive, so as to make my Rest Service reactive. I am returning ResponseEntity<Flux<Document>> as response to my

Failed to connect Azure servicebus topic using JMS - Java

I followed steps as mentioned in Azure ServiceBus JMS Sample with below properties spring.jms.servicebus.connection-string=Endpoint=sb://test-dt.servicebus.wind

StreamsException: Unable to initialize state, this can happen if multiple instances of Kafka Streams are running in the same state directory

This is regarding upgrading existing code base in production which uses windowing from kafka-clients,kafka-streams,spring-kafka 2.4.0 to 2.6.x and also upgradi

How to configure Spring Boot entity for GeoJSON?

I want to save a GeoJSON to database by using Spring Boot and JPA Example JSON object: { "type": "FeatureCollection", "features": [ { "type":

Unable to create a ConnectionFactory Error with H2 and R2DBC in Spring Boot with WebFlux

I've created a Java Spring Boot service using the WebFlux reactive module, H2 in-memory database, and R2DBC reactive driver. When I run the service, it fails wi

Truncating, Selecting data from multiple tables using joins and then inserting data into separate table in spring boot

I am using a spring boot application. I have multiple tables and using inner joins, I want to populate a temp table. Before populating, I have to truncate the t

How to design a Spring REST server with a parallel business logic function

I'm currently building server software in Java. I already have a running backend, which is build with Spring Boot. It has an REST interface to read and write da

Problem to read data from HBase on AWS EMR cluster using Java Spring boot client

I'm trying to write a simple API application to read data from HBase on an AWS EMR cluster. But I get an UnknownHostException when I try to send the reques

How to remove foreign key without deleting the whole entity

I am new to Spring boot and I want to be able to delete the value of a forgein key if its entity is removed without deleting the whole entity linked to it; I ex

How to set a custom principal object during or after authentication?

I've changed the way a user is authenticated in my backend. From now on I am receiving JWT tokens from Firebase which are then validated on my Spring Boot serve