概述
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
解决方法:
我是导包出了问题
这里不应该导入
import org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory;
包而是
import org.apache.commons.dbcp.BasicDataSourceFactory;
大家注意导包问题哦
我也不知道为什么要导这个quq 我是啥子…
最后
以上就是超级乌龟为你收集整理的HTTP Status 500 – Internal Server Error Type 异常报告 消息 Servlet execution threw已解决的全部内容,希望文章能够帮你解决HTTP Status 500 – Internal Server Error Type 异常报告 消息 Servlet execution threw已解决所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复