When using NIO connectors, it appears that the contextDestroyed method is not invoked. Tested on Apache Tomcat 9.0.104 and 10.1.44.
Configuration (server.xml – Connector tag):
Using
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
protocol="org.apache.coyote.http11.Http11Nio1Protocol"
contextDestroyed is not called.
Using
protocol="org.apache.coyote.http11.Http11AprProtocol"
contextDestroyed is called as expected.