JSP上的500错误

时间:2016-11-24 07:08:57

标签: jsp http tomcat web-applications

我使用JSP Page创建了一个Web应用程序,但是它抛出了以下错误。

工作流程:Index.jsp => login.jsp =>在JAVA文件中定义的calltomethods。

的index.jsp:

<html>    
<body>

<form action="login.jsp">    

<table>    
<tr>
    <td> System: <input type="text" name="cmsname"/> </td>
</tr>    
<tr>
    <td> User Name: <input type="text" name="username"/> </td>
</tr>    
<tr>
    <td> Password: <input type="password" name="password"/> </td>
</tr>    
</table>

<input type = "submit" value = "Login">    
</form>

<form action="download.jsp">    
<input type = "submit" value = "Donwload File">    
</form>

</body>

的login.jsp

<%@ page import = "com.aksl.internal.java.*" %>
<%@ page import = "javax.servlet.http.*" %>
<%@ page import = "java.io.IOException" %>

<html>
<body>

<%     
    String cmsname = request.getParameter("cmsname");
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    InitComCms initcmslogin = new InitComCms(); 
        initcmslogin.setCMS(cmsname);
        initcmslogin.setUserId(username);
        initcmslogin.setPassword(password);
        initcmslogin.callsToMethods();
%>

alert("User is logged in");

</body>    
</html>

InitComCms.java

此文件具有登录系统和获取详细信息的所有逻辑。此代码还将所有详细信息写入excel文件以及本地驱动器。

错误:

Nov 24, 2016 12:34:10 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/UserList41] threw exception [An exception occurred processing JSP page /login.jsp at line 13

10:     String cmsname = request.getParameter("cmsname");
11:     String username = request.getParameter("username");
12:     String password = request.getParameter("password");
13:     InitComCms initcmslogin = new InitComCms(); 
14:         initcmslogin.setCMS(cmsname);
15:         initcmslogin.setUserId(username);
16:         initcmslogin.setPassword(password);


Stacktrace:] with root cause
java.lang.ClassNotFoundException: org.apache.poi.ss.usermodel.Row
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    at org.apache.jsp.login_jsp._jspService(login_jsp.java:126)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

顺便说一句,我是java中的新蜜蜂。以下是login.jsp文件中的第13行:

InitComCms initcmslogin = new InitComCms(); 

请帮忙。提前谢谢。

1 个答案:

答案 0 :(得分:0)

您的类路径中缺少poi-VERSION.jar。为您的代码选择正确的版本,并将其添加到您的webapp的WEB-INF/lib文件夹中。