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!
spring-boot
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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;
...
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....
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) (...
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:...
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-...
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 ...
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.
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 ...
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 ...