Servlet execution threw an exception 怎解决?
HTTPStatus500-ServletexecutionthrewanexceptiontypeExceptionreportmessageServletexecut...
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: com/google/gson/Gson
com.yg.examle.JsonServlet.doPost(JsonServlet.java:93)
com.yg.examle.JsonServlet.doGet(JsonServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.ClassNotFoundException: com.google.gson.Gson
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
com.yg.examle.JsonServlet.doPost(JsonServlet.java:93)
com.yg.examle.JsonServlet.doGet(JsonServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 展开
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: com/google/gson/Gson
com.yg.examle.JsonServlet.doPost(JsonServlet.java:93)
com.yg.examle.JsonServlet.doGet(JsonServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.ClassNotFoundException: com.google.gson.Gson
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
com.yg.examle.JsonServlet.doPost(JsonServlet.java:93)
com.yg.examle.JsonServlet.doGet(JsonServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 展开
2个回答
展开全部
缺少依赖库,
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.3.1</version>
</dependency>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你这个是本地的程序,还是调用别人的接口?
从请求状态Http Status 500可以知道,服务端的代码有错误。所以,如果是本地代码,你需要调试。如果是第三方接口,你需要联系接口开发人员。
从请求状态Http Status 500可以知道,服务端的代码有错误。所以,如果是本地代码,你需要调试。如果是第三方接口,你需要联系接口开发人员。
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询