我在我的项目中添加了几个外部Jar库,当我执行这行代码时它给了我这个错误:
<%
GitlabAPI gitlabAPI = GitlabAPI.connect(url, token);
%>
根本原因
javax.servlet.ServletException: java.lang.NoClassDefFoundError:org / gitlab / api / GitlabAPI org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:916) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:845) org.apache.jsp.Dashboard_jsp._jspService(Dashboard_jsp.java:232) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 根本原因
java.lang.NoClassDefFoundError:org / gitlab / api / GitlabAPI com.atp.servlets.GitLabIntegration.FetchProjects(GitLabIntegration.java:14) org.apache.jsp.Dashboard_jsp._jspService(Dashboard_jsp.java:178) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 根本原因
java.lang.ClassNotFoundException:org.gitlab.api.GitlabAPI org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892) org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735) com.atp.servlets.GitLabIntegration.FetchProjects(GitLabIntegration.java:14) org.apache.jsp.Dashboard_jsp._jspService(Dashboard_jsp.java:178) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
但是我有所有缺少的类。 即使我在GitlabAPI上单击alt-enter,它也会导入正确的包。 为什么这个抛出类没有找到错误?