tomcat Server Error: 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.
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.
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.
An error is also reported in the console
Obviously, the driver was not found
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.sql.SQLException: No suitable driver found for jdbc: mysql://localhost:3306
Solution: check whether the jar package is correctly placed under web/WEB-INF/lib
Add to the directory to correctly identify and use:
Read More:
- Java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver [How to Solve]
- [Solved] Cannot find class: com.mysql.jdbc.Driver
- [Solved] Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find cla
- [Solved] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure error
- [Solved] SSM startup error: ClassNotFoundException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- [Solved] You must configure either the server or JDBC driver (via the ‘serverTimezone‘ configuration proper
- [Solved] java: Internal error in the mapping processor: java.lang.NullPointerException
- [Solved] Java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
- Request processing failed; nested exception is java.lang.NullPointerException or UnsatisfiedDependencyE
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException
- Java uses class array to report error Exception in thread “main” java.lang.NullPointerException solution
- [Solved] Maven Project Error: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Resolve warning: could’t clear Tomcat cache java.lang.NoSuchFieldException: resourceEntries
- [Solved] Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
- Tinyint error: java.lang.NullPointerException… [How to Solve]
- [Solved] Openfegn Remote Call Error: java.lang.NullPointerException: null
- [Solved] fragment error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}…
- [Solved] JAVA Project Import jstl Error: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
- Tomcat cross server upload error 403forbidden [How to Solve]