Answer for error: Failed to destroy the filter named [tomcat websocket (jsr356) filter] of type [org.apache.tomcat.websocket.server.wsfilter]

I encountered an error while trying to destroy the filter named [tomcat websocket (jsr356) filter] of type [org.apache.tomcat.websocket.server.wsfilter].

To resolve this issue, I would:

  1. Check if there are any dependencies or configurations missing that might be causing the filter destruction to fail.
  2. Ensure that the Tomcat WebSocket (JSR356) filter is properly configured and initialized before attempting to destroy it.
  3. If applicable, try restarting the Tomcat server and then attempt to destroy the filter again.

The way I solved it was not by excluding the dependencies in my project but by changing the way I compile my project.

Now I use the command mvn clean install from the IntelliJ command line for compiling. For executing, I move into the target directory so that I can execute the generated .jar in this folder with java -jar jarname.jar from the IntelliJ command line.