qq_44825453
qq_44825453
2019-04-22 20:34

编写的java登录页面一运行就报这样的错误

  • java
  • tomcat

HTTP Status 500 – Internal Server Error
Type Exception Report

Message Servlet execution threw an exception

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: Servlet execution threw an exception
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.NoClassDefFoundError: com/itheima/Utils/DruidUtils
com.itheima.Dao.loginDao.findUserByNameAndPwd(loginDao.java:13)
com.itheima.service.LoginService.login(LoginService.java:10)
com.itheima.web.servlet.LoginServlet.doPost(LoginServlet.java:39)
com.itheima.web.servlet.LoginServlet.doGet(LoginServlet.java:55)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
Root Cause

java.lang.ClassNotFoundException: com.itheima.Utils.DruidUtils
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
com.itheima.Dao.loginDao.findUserByNameAndPwd(loginDao.java:13)
com.itheima.service.LoginService.login(LoginService.java:10)
com.itheima.web.servlet.LoginServlet.doPost(LoginServlet.java:39)
com.itheima.web.servlet.LoginServlet.doGet(LoginServlet.java:55)
javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
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.

运行报错找不到原因

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答