Coffee_lover
Coffee_lover

Reputation: 557

Tomcat restart throws error regarding the missing destroy() method

My service is deployed on tomcat. Recently we upgraded the tomcat to 9.0.43. And when the service is restarted (tomcat is installed on windows as a service), it throws the following error:

SEVERE [Thread-19] org.apache.catalina.core.ApplicationFilterConfig.release Failed to destroy the filter named [Tomcat WebSocket (JSR356) Filter] of type [org.apache.tomcat.websocket.server.WsFilter]
    java.lang.AbstractMethodError: Receiver class org.apache.tomcat.websocket.server.WsFilter does not define or inherit an implementation of the resolved method abstract destroy()V of interface javax.servlet.Filter.
        at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:301)

I looked into and find the root cause. Earlier there was a destroy method implementation in tomcat-websocket.jar in the WsFilter.class under lib\tomcat-websocket\org\apache\tomcat\websocket\server\WsFilter.class, which is now missing.

How shall I proceed now? Any ideas?

Upvotes: 2

Views: 5586

Answers (1)

Piotr P. Karwasz
Piotr P. Karwasz

Reputation: 16105

Since Servlet 4.0 API the init and close methods of the Filter interface have default implementations. Check if you are not deploying another (and older) javax.servlet-api.jar with your application.

Upvotes: 3

Related Questions