Skip to content

UnsupportedOperationException is thrown from war when shutting down Tomcat #21684

@gurpreetsingh85

Description

@gurpreetsingh85

war.zip

This issue is only happening with 2.3.0 release of Spring Boot. Shutting down my application throws the following exception.

SEVERE: Exception sending context destroyed event to listener instance of class [org.springframework.boot.web.servlet.support.SpringBootServletInitializer$1]
java.lang.UnsupportedOperationException: Section 4.4 of the Servlet 3.0 specification does not permit this method to be called from a ServletContextListener that was not defined in web.xml, a web-fragment.xml file nor annotated with @WebListener
	at org.apache.catalina.core.StandardContext$NoPluggabilityServletContext.getClassLoader(StandardContext.java:6683)
	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.deregisterJdbcDrivers(SpringBootServletInitializer.java:134)
	at org.springframework.boot.web.servlet.support.SpringBootServletInitializer$1.contextDestroyed(SpringBootServletInitializer.java:110)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4730)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5397)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1400)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1389)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:976)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1400)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1389)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
	at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
	at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:976)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:473)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:992)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257)
	at org.apache.catalina.startup.Catalina.stop(Catalina.java:706)
	at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:803)

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions