javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se

javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

idea2019.3.2 链接mysql数据库报错如下图
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se

解决方法

第一步从tomcat中移除项目

打开tomcat配置页面
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se
点击deployment选中项目并移除
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se

第二步idea重新构建项目

file–>project structure–>artifacts
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se

第三步在tomcat中从新部署项目

javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se
重新部署项目
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.se

完成上面步骤之后启动服务器运行项目成功