Skip to main content

Questions tagged [spring-boot]

Use the Spring Boot tag for questions related to spring boot framework and the features it brings to your Web application. This includes questions about configuration, embedding of the Web servers, setting up metrics, health checks, externalized configuration etc. It does not include questions about the Web server itself, Java code running in your application, or standard spring components. Tag these questions with its own tags to get the best response!

67,108 questions with no upvoted or accepted answers
11 votes
0 answers
7k views

What is the cleaner and efficient way of implementing health check for Kafka in my spring boot application?

I have a spring boot (2.1.6) application that both consumes and produces messages to a (organization wide) common kafka instance. I am trying to implement health checks for this kafka broker in my ...
ishan's user avatar
  • 1,232
11 votes
0 answers
2k views

EC2 Instance - Sending STDOUT logs to Cloud Watch

Reading the 12factor app in the logging chapter, it suggests that the application logs should be sent to STDOUT. I found plenty of documentation on how to get the logs from STDOUT and send it to ...
Thiago's user avatar
  • 960
11 votes
0 answers
1k views

Getting "com.mongodb.MongoInternalException: The responseTo in the response does not match the requestId in the request" while connecting to mongodb

My app is using Spring-Boot framework. Everything was working fine until GC overhead error occurred. GC error was recovered but mongodb connection was giving this error continuously after it. But at ...
Harshit's user avatar
  • 1,372
11 votes
1 answer
5k views

How to shutdown application context between tests

I have 3 groups of tests: unit, integration, acceptance. Latter two groups launches ApplicationContext: minimal for "integration" and full for "acceptance". Both application contexts register queue ...
Sergey Galkin's user avatar
11 votes
3 answers
16k views

How to get the version of Spring Boot in the /info actuator endpoint

It's possible to include the version of Spring Boot in the banner.txt by adding ${spring-boot.version}. How can I do the same for the /info actuator endpoint? I've tried adding both of the following ...
jonathan.stiles's user avatar
11 votes
3 answers
2k views

Alternative for org.apache.commons.mail.util.MimeMessageParser compatible with Jakarta on Java 17

As I updated my Spring Boot application to Java 17 and Spring Boot 3, I migrated from Java EE to Jakarta. I used the MimeMessageParser of org.apache.commons.mail.util.MimeMessageParser, but it expects ...
pinacolada's user avatar
11 votes
1 answer
6k views

Can I use @MockBean to mock a bean in just one method of my test class?

I have this mvc test class @RunWith(SpringRunner.class) @SpringBootTest public class UserTest { private MockMvc mockMvc; @Resource private WebApplicationContext webApplicationContext; ...
Datz's user avatar
  • 3,599
10 votes
1 answer
12k views

Spring boot 3 upgrade: java.lang.NoClassDefFoundError: org/springframework/util/SocketUtils

Looks like SocketUtils is deprecated now as a part of spring boot 3 upgrade. While running controller tests, I am getting below error. Anyone have come across it and how was it solved? main] o.s.test....
sof_user's user avatar
  • 215
10 votes
1 answer
7k views

Spring Boot testing: Cannot bind @ConfigurationProperties - Ensure that @ConstructorBinding has not been applied

In a Spring Boot unit test, how can you mock @ConstructorBinding @ConfigurationProperties data class? Setup Both Kotlin 1.4.30 (for unit tests and config classes) Java 15 (with --enable-preview) (...
aSemy's user avatar
  • 6,823
10 votes
0 answers
3k views

Spring boot context load test hangs

We have a Spring Boot app written in Kotlin. The problem is it hangs during Maven clean test while running context load test below. Java: 14.0.1 Kotlin: 1.4.20 Spring boot:2.3.6.RELEASE Spring cloud:...
Vahid's user avatar
  • 1,827
10 votes
1 answer
2k views

Spring context indexer not working for dependency jar

I have some library jar lib.jar (made using spring boot but packaged as normal jar without spring boot plugin) which is made of spring boot and contains spring.components file generated by spring-...
Mahesh Bhuva's user avatar
10 votes
2 answers
3k views

SpringBoot hibernate gradle byte code enhancement

I am trying to mane hibernate OneToOne relationships work lazily. My setup is spring-data-jpa using hibernate and Gradle. Even this is a well-documented problem/feature and there is a lot of good ...
maxsap's user avatar
  • 2,981
10 votes
1 answer
3k views

Kafka Connect with Spring Framework

Is anyone aware of any Spring Boot integration with Kafka Connect? There is a spring-kafka project that I think gives a nice integration with Kafka clients but not connect and streams APIs.
dmaity's user avatar
  • 101
10 votes
0 answers
3k views

Spring Boot, Tomcat & Gradle: xalan & serializer jars not found

Yesterday I tried to merge some single spring boot projects into one new project and since then I am getting the following errors in my ide console when starting the project: Ignoring Class-Path ...
StephanM's user avatar
  • 1,380
10 votes
0 answers
1k views

Configuring custom Json Serializer for Spring controller test

I'm testing a controller: @RestController() public class MessagesController { ... } Using @WebMvcTest annotation: @RunWith(SpringRunner.class) @WebMvcTest(value = {MessagesController.class}) public ...
ElArbi's user avatar
  • 1,185

15 30 50 per page