servlet 调用java类时报错,jar包都导入了!

qq_36528060 2017-12-21 10:41:02
HTTP Status 500 - Servlet execution threw an exception


type Exception report

message Servlet execution threw an exception

description The server encountered an internal error that prevented it from fulfilling this 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: javax/mail/Message
com.ningmeng.web.LoginServlet.doPost(LoginServlet.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



root cause
java.lang.ClassNotFoundException: javax.mail.Message
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
com.ningmeng.web.LoginServlet.doPost(LoginServlet.java:43)
javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



note The full stack trace of the root cause is available in the Apache Tomcat/7.0.82 logs.
...全文
529 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_36528060 2017-12-22
  • 打赏
  • 举报
回复
解决了,把mail.java放到Dao包下就行了
qq_36528060 2017-12-22
  • 打赏
  • 举报
回复
怎么clean
望崖 2017-12-22
  • 打赏
  • 举报
回复
一般,清理缓存(clean)重启服务器重新发布项目,即可。
望崖 2017-12-22
  • 打赏
  • 举报
回复
是不是发邮件。
xy825459556 2017-12-22
  • 打赏
  • 举报
回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧