When using 2.3.0.M4 using the layered jar option
<layers>
<enabled>true</enabled>
</layers>
everything worked fine until I added this property: server.shutdown.grace-period=20s
I get the following exception when I stop the container using "ctrl-c":
CException in thread "SpringContextShutdownHook" java.lang.NoSuchMethodError: org.apache.catalina.core.StandardContext.getInProgressAsyncCount()J
at org.springframework.boot.web.embedded.tomcat.TomcatGracefulShutdown.active(TomcatGracefulShutdown.java:91)
at org.springframework.boot.web.embedded.tomcat.TomcatGracefulShutdown.shutDownGracefully(TomcatGracefulShutdown.java:68)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.shutDownGracefully(TomcatWebServer.java:396)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.doClose(ServletWebServerApplicationContext.java:175)
at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:948)
using this dockerfile:
FROM amazoncorretto:8u242 as builder
WORKDIR myapp
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} myapp.jar
RUN java -Djarmode=layertools -jar myapp.jar extract
FROM amazoncorretto:8u242
WORKDIR myapp
COPY --from=builder myapp/dependencies/ ./
COPY --from=builder myapp/spring-boot-loader/ ./
COPY --from=builder myapp/application/ ./
COPY config/ config/
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
Comment From: wilkinsona
Thanks for the report and for trying out M4. It requires Tomcat 9.0.33 (where the getInProgressAsyncCount()
) method was added. If you make use of Spring Boot's dependency management that is the version that will be used by default.