Category "spring-boot"

Strict @MockBean in a Spring Boot Test

I am developing a Spring Boot application. For my regular service class unit tests, I am able to extend my test class with MockitoExtension, and the mocks are s

Post request with content type application/x-www-form-urlencoded not working in Spring

I'm using OpenAPI generator to generate Spring REST APIs. Here is a fragment: openapi: 3.0.2 info: version: 1.0.0 title: Auth paths: '/auth/v1/token':

Spring jar can't see resources

I have Spring Boot web app which work on IntelliJ. I build jar file from maven. Jar starts but css, js and img "blocked" in Chrome console show error 404, Firef

Spring JPA not returning Foreign keys in response

I have a database with some entities, ( in parent child relationship )I can say and when When I try to make a query to child table to get all the rows, I only g

java.lang.NoSuchMethodError: com.mongodb.client.MongoCollection.insertOne exception when inserting entry to Javers Mongodb collection

I am able to insert the data to mongodb collection. Same time Javers framework trying to insert the data to jv_snapshots collection. Data insertion to jv_snapsh

Failed to get correlation key for `citrus_message_correlator_HttpClient`

I have a CitrusEndpoints server configuration @Bean public HttpServer myService() { return CitrusEndpoints. http(). server().

Spring Boot now displaying the index.jsp page

I am a newbie with Spring boot. I am trying to return my index page in the controller but I am not able to. Its just returning the word index in the output. Her

Spring cloud bus not updating config property for all instances

I am using spring cloud bus with kafka to update the config property for multiple instances at once. I have a cloud-config server running on localhost:8888, Fin

GraalVM Native Image failing on Springdoc dependency

I am trying to create a sample application using spring boot and GraalVM Native Image, however as soon as I add the dependency for Springdoc the generated execu

Getting reactor.pool.PoolShutdownException during save in database

Service is using org.springframework.r2dbc.core.DatabaseClient with reactor-pool and r2dbc-mysql driver. I'm doing inserts in the database every 5-10 seconds (5

change the json object value

{ "onboardingInformation": { "apiInvokerPublicKey": "string", "apiInvokerCertificate": "string", "onboardingSecret": "string" }, "notification

Pass value from properties to @Column annotation

Helo, Is it possible to pass value from application.properties to @Column annotation in entity? I tried this: @Column(name = "${foo.column-name}") private Strin

Spring boot autowired service all variable fields are null

Currently I have many spring boot services annotated with @Service. Every service works fine and there are no problems. There is a problem only with LogsService

Unsafe object binding checkmarx spring boot application

I'm getting this alert from checkmarx, saying that i have an unsafe object binding when trying to save a comment. I've read that we mustn't save objects directl

Connection refused trying to connect spring boot application in docker

I try to run spring boot application in Docker, Circle CI. Please, check how my .circleci/config.yml file looks like: version: 2.1 jobs: test: docker:

Docker WARNING: Published ports are discarded when using host network mode

I have a Springboot app that I have Dockerized. I have it exposed on port 8081, and can access it as expected. http://<ipaddress>:8081 Problem The Spring

Spring Boot JDBC microservices cannot connect to MySQL in docker

I have 2 Spring Boot microservices that need to connect to a MySQL service which itself is deployed in Docker. I'm using Docker Compose but for some reason they

org.springframework.boot.web.reactive.error.DefaultErrorAttributes is not getting called anymore in org.springframework.boot:2.3.1.RELEASE

Spring reactive web: Earlier in spring boot 2.2.*, i was using a class that extends DefaultErrorAttributes. This class was used to handle exceptions globally fo

Pushing metrics data to Prometheus

I am configuring Prometheus to access Spring boot metrics data. For some of the metrics, Prometheus's pull mechanism is ok, but for some custom metrics I prefer

Web socket CORS issue in SpringBoot

I was working on implementing web sockets in springboot, I followed the example spring has given in there docs. But I am getting cors error while trying to conn