jingyubuyu
2022-06-21 11:43
采纳率: 0%
浏览 15

登陆成功后页面出现 HTTP Status 500

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)

错误页面出现这个情况,怎么解决呢
求小伙伴帮助

2条回答 默认 最新

相关推荐 更多相似问题