HTTP Status 500 – Internal Server Error Type 异常报告 消息 Servlet execution threw已解决

HTTP Status 500 – Internal Server Error

Type 异常报告

消息 Servlet execution threw an exception

描述 服务器遇到一个意外的情况,阻止它完成请求。

Exception
javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
bookstore.web.filter.EncodingFilter.doFilter(EncodingFilter.java:23)

Root Cause
java.lang.AbstractMethodError: com.mysql.jdbc.Connection.isValid(I)Z
org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:874)
org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:270)
org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:630)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:119)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:731)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:605)
org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getLogWriter(BasicDataSource.java:1110)
org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:554)
bookstore.utils.DBCPUtil.getDataSource(DBCPUtil.java:30)
bookstore.dao.UserDao.findByNameAndPwd(UserDao.java:15)
bookstore.service.UserService.login(UserService.java:17)
bookstore.web.servlet.LoginServlet.doGet(LoginServlet.java:30)
bookstore.web.servlet.LoginServlet.doPost(LoginServlet.java:64)
javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
bookstore.web.filter.EncodingFilter.doFilter(EncodingFilter.java:23)

Note 主要问题的全部 stack 信息可以在 server logs 里查看

Apache Tomcat/9.0.17

HTTP Status 500 – Internal Server Error Type 异常报告 消息 Servlet execution threw已解决_第1张图片

解决方法:
HTTP Status 500 – Internal Server Error Type 异常报告 消息 Servlet execution threw已解决_第2张图片
我是导包出了问题
这里不应该导入
import org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory;
包而是
import org.apache.commons.dbcp.BasicDataSourceFactory;
HTTP Status 500 – Internal Server Error Type 异常报告 消息 Servlet execution threw已解决_第3张图片

大家注意导包问题哦
我也不知道为什么要导这个quq 我是啥子…

你可能感兴趣的:(一些报错,java,tomcat,servlet,web.xml)