tomcat服务器报错 java.lang.NullPointerException
Type Exception Report
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
java.lang.NullPointerException com.gxa.login.dbutils.DBUtils.executeQuery(DBUtils.java:26) com.gxa.login.dao.LoginDao.queryInfo(LoginDao.java:16) com.gxa.login.service.LoginService.login(LoginService.java:15) com.gxa.login.service.LoginServlet.doPost(LoginServlet.java:27) javax.servlet.http.HttpServlet.service(HttpServlet.java:661) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)Note The full stack trace of the root cause is available in the server logs.
在控制台中也报错
很明显是没有找到驱动
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306
解决办法:检查jar包是否正确放在web/WEB-INF/lib下面
添加进目录中,才能正确识别使用: