Relative Content

Tag Archive for spring-boot

Spring Boot Stall At Java 17

I have an odd issue happening with Spring Boot and Java 17 that I would like to get some advice on how best to debug/resolve. This application was built with Spring Boot 2.7.18. It runs on a Linux server. The application runs fine when using a Java 1.8 JRE. However, when I switch to using a Java 17 JRE, the application works ok for a minute or two, and then the browser will clock when it sends a request to the Spring Boot application.

SpringBoot @WebMvcTest enable AutoConfiguration for @ControllerAdive

I wrote my own @RestControllerAdvice bean and wanted it to be reusable through my projects.
Thus, I wrote my own @AutoConfiguration to set it up, which works like a charm – except for @WebMvcTests where it is not autoconfigured.
I understand that @WebMvcTest does not autoconfigure everything but now I wonder how to set it up properly (without @Autowiring it in every MvcTest).

SpringBoot @WebMvcTest enable AutoConfiguration for @ControllerAdive

I wrote my own @RestControllerAdvice bean and wanted it to be reusable through my projects.
Thus, I wrote my own @AutoConfiguration to set it up, which works like a charm – except for @WebMvcTests where it is not autoconfigured.
I understand that @WebMvcTest does not autoconfigure everything but now I wonder how to set it up properly (without @Autowiring it in every MvcTest).

spring-boot and Tomcat compatability

Spring boot 3.3.2 and tomcat 11.0.0-M22
Description : An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.lambda$customizeRejectIllegalHeader$21(TomcatWebServerFactoryCustomizer.java:227)

spring-boot and Tomcat compatability

Spring boot 3.3.2 and tomcat 11.0.0-M22
Description : An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.autoconfigure.web.embedded.TomcatWebServerFactoryCustomizer.lambda$customizeRejectIllegalHeader$21(TomcatWebServerFactoryCustomizer.java:227)

How to inject cron expression value

public class Properties { @Value(“${scheduler.cron:0 0/15 * * * *”) private String schedulerCron; public Properties() { //schedulerCron = “0 0/15 * * * *”; } } If I do not use @Value and populate the property as I have in constructor, I am able to use it. But I am not able to inject it […]