HTTP Status 500 -
type Exception report
message
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
com.southwind.dao.impl.SystemAdminDaoImpl.findByUsername(SystemAdminDaoImpl.java:18)
com.southwind.service.impl.SystemAdminServiceImpl.login(SystemAdminServiceImpl.java:18)
com.southwind.controller.AccountServlet.doPost(AccountServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
try {
statement = connection.prepareStatement(sql); //com.southwind.dao.impl.SystemAdminDaoImpl.findByUsername(SystemAdminDaoImpl.java:18)
resultSet = statement.executeQuery();
if (resultSet.next()) {
int id = resultSet.getInt(1);
username = resultSet.getString(2);
String password = resultSet.getString(3);
String name = resultSet.getString(4);
String telephone = resultSet.getString(5);
return new SystemAdmin(id,username,password,name,telephone);
}
SystemAdmin systemAdmin = this.systemAdminDao.findByUsername(username); //com.southwind.service.impl.SystemAdminServiceImpl.login(SystemAdminServiceImpl.java:18)
SystemAdminDto systemAdminDto = new SystemAdminDto();
case "systemAdmin":
SystemAdminDto systemAdminDto = this.systemAdminService.login(username, password); //com.southwind.controller.AccountServlet.doPost(AccountServlet.java:39)
错误页面出现这个情况,怎么解决呢
求小伙伴帮助