From 5705a58914789964a52c6b90c4b2eff6dd664128 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Wed, 24 Jan 2024 20:58:13 +0100 Subject: [PATCH 1/4] fix #659 implement a workaround for the issue that Spring Boot 3.2.x did implement new boot-loader code for uber jars. See https://github.com/spring-projects/spring-boot/issues/38636 for details. --- .../java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java index fd71d780..e63a785b 100644 --- a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java +++ b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java @@ -29,7 +29,9 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.data.web.config.EnableSpringDataWebSupport; import org.springframework.scheduling.annotation.EnableAsync; @@ -38,8 +40,9 @@ import org.springframework.util.StringUtils; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.handler.HandlerMappingIntrospector; -@SpringBootApplication +@SpringBootApplication(exclude = { WebMvcAutoConfiguration.class }) @EnableScheduling @EnableAsync @EnableSpringDataWebSupport @@ -113,4 +116,9 @@ public void addCorsMappings(CorsRegistry registry) { }; } + @Bean(name = "mvcHandlerMappingIntrospector") + public HandlerMappingIntrospector mvcHandlerMappingIntrospector() { + return new HandlerMappingIntrospector(); + } + } From 61813ba5cce39832c8c37b655e3d8408db4ebedb Mon Sep 17 00:00:00 2001 From: nitram509 Date: Wed, 24 Jan 2024 21:00:30 +0100 Subject: [PATCH 2/4] reformat --- src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java index e63a785b..907cad7f 100644 --- a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java +++ b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java @@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; @@ -42,7 +41,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.handler.HandlerMappingIntrospector; -@SpringBootApplication(exclude = { WebMvcAutoConfiguration.class }) +@SpringBootApplication(exclude = {WebMvcAutoConfiguration.class}) @EnableScheduling @EnableAsync @EnableSpringDataWebSupport @@ -94,7 +93,7 @@ public Attributes loadAttributesFromManifest() { LOG.warn("can't determine version info from manifest, error: " + e.getMessage()); } } else { - LOG.warn("MANIFEST.MF file not present in classpath; will use 'dev' as version information"); + LOG.warn("MANIFEST.MF file not present in classpath; will use 'dev' as version information"); } } final Attributes attributes = new Attributes(); @@ -120,5 +119,4 @@ public void addCorsMappings(CorsRegistry registry) { public HandlerMappingIntrospector mvcHandlerMappingIntrospector() { return new HandlerMappingIntrospector(); } - } From 31d6d063de073e4115fa79e6376e11fdfda39377 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Wed, 24 Jan 2024 21:20:07 +0100 Subject: [PATCH 3/4] drop the change in the SpringBootApp and switch back to old packaging of SpringBoot --- pom.xml | 3 +++ .../java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java | 12 +++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 02924c6b..474b9050 100644 --- a/pom.xml +++ b/pom.xml @@ -329,6 +329,9 @@ repackage + + CLASSIC + diff --git a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java index 907cad7f..3a6f96ef 100644 --- a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java +++ b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java @@ -30,7 +30,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.data.web.config.EnableSpringDataWebSupport; import org.springframework.scheduling.annotation.EnableAsync; @@ -39,9 +38,8 @@ import org.springframework.util.StringUtils; import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.handler.HandlerMappingIntrospector; -@SpringBootApplication(exclude = {WebMvcAutoConfiguration.class}) +@SpringBootApplication(/*exclude = {WebMvcAutoConfiguration.class}*/ ) @EnableScheduling @EnableAsync @EnableSpringDataWebSupport @@ -93,7 +91,8 @@ public Attributes loadAttributesFromManifest() { LOG.warn("can't determine version info from manifest, error: " + e.getMessage()); } } else { - LOG.warn("MANIFEST.MF file not present in classpath; will use 'dev' as version information"); + LOG.warn( + "MANIFEST.MF file not present in classpath; will use 'dev' as version information"); } } final Attributes attributes = new Attributes(); @@ -114,9 +113,4 @@ public void addCorsMappings(CorsRegistry registry) { } }; } - - @Bean(name = "mvcHandlerMappingIntrospector") - public HandlerMappingIntrospector mvcHandlerMappingIntrospector() { - return new HandlerMappingIntrospector(); - } } From f9670ba9e5f2ba14c059b41446f06861738b02f4 Mon Sep 17 00:00:00 2001 From: nitram509 Date: Wed, 24 Jan 2024 21:20:50 +0100 Subject: [PATCH 4/4] remove comment --- src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java index 3a6f96ef..aeb6367f 100644 --- a/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java +++ b/src/main/java/io/zeebe/monitor/ZeebeSimpleMonitorApp.java @@ -39,7 +39,7 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -@SpringBootApplication(/*exclude = {WebMvcAutoConfiguration.class}*/ ) +@SpringBootApplication @EnableScheduling @EnableAsync @EnableSpringDataWebSupport