Skip to content

ServletContextListener contextDestroyed is not called when Undertow stops #13134

@Xiaobaxi

Description

@Xiaobaxi

Spring boot:1.5.12.RELEASE
Container:spring-boot-starter-undertow

when i defined the MyServletContextListener class with the @weblistener annotation
and add the @ServletComponentScan annotation on the bootstrap class

when i start the server
1、EmbeddedWebApplicationContext#onRefresh called the createEmbeddedServletContainer
2、UndertowEmbeddedServletContainerFactory#createDeploymentManager
3、DeploymentImpl#deploy method will add the MyServletContextListene
4、the MyServletContextListener#contextInitialized method called
but when i stop the server
1、EmbeddedWebApplicationContext#onClose called the stopAndReleaseEmbeddedServletContainer
2、UndertowEmbeddedServletContainer#stop
3、DeploymentManager#stop, do not called the undeploy method, so the contextDestroyed is not called

How can I solve it? By the way,change the spring-boot-starter-tomcat it is ok

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions