java - 用tomcat部署web项目的时候,tomcat启动成功,但是却打不开项目的login.jsp页面 显示500错误
PHP中文网
PHP中文网 2017-04-18 09:47:15
0
4
1326

如题,
错误页面如下显示

error.jsp页面显示如下:(我新建一个jsp页面,却并不会出现上述图片的问题,很奇怪啊)
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause

java.lang.NullPointerException

org.apache.jsp.Error_jsp._jspService(Error_jsp.java:42)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

note The full stack trace of the root cause is available in the Tomcat logs.

Apache Tomcat/5.0.16

tomcatlog 中的日志为 :
2016-08-12 06:35:29 StandardContext[/jsp-examples]ContextListener: contextInitialized()
2016-08-12 06:35:29 StandardContext[/jsp-examples]SessionListener: contextInitialized()
2016-08-12 06:35:29 StandardContext[/servlets-examples]ContextListener: contextInitialized()
2016-08-12 06:35:29 StandardContext[/servlets-examples]SessionListener: contextInitialized()
2016-08-12 06:36:12 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException

at org.apache.jsp.Error_jsp._jspService(Error_jsp.java:42)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
at java.lang.Thread.run(Unknown Source)

%>
ERROR.JSP
<%@ page
language = "java"
isErrorPage = "true"
contentType = "text/html; charset=gb2312"
%>

<html>

<head>
<title>错误信息</title>
</head>

<body bgcolor="#CCCCCC">
<center>

    <p><font size="5"><b>错误信息</b></font></p>
    <p>&nbsp;</p>
    <p><font><%=exception.toString()%></font></p>
    <p>&nbsp;</p>
    <p><font><a href="javascript:history.back();">返回上一页</a></font></p>
    <p>&nbsp;</p>

</center>
</body>

</html>

LOGIN.JSP
<%@ page
info = "用户登陆的 jsp"
errorPage = "Error.jsp"
contentType = "text/html; charset=gb2312"
import = "java.io.*"
import = "java.util.*"
import = "java.sql.*"
import = "qesuite.*"
%>

<%--实例化DBConnection对象dbConnection:建立连接池,预先建立三个数据库连接--%>
<jsp:useBean id="dbConnection" scope="application" class="qesuite.DBConnection" >

            <jsp:setProperty name="dbConnection" property="poolSwitch" value="on" />

</jsp:useBean>

<%--实例化DBBridge对象dbBridge--%>
<jsp:useBean id="dbBridge" scope="page" class="qesuite.DBBridge" >

    <jsp:setProperty name="dbBridge" property="dbConnection" value="<%=dbConnection%>" />
    <jsp:setProperty name="dbBridge" property="bridgeSwitch" value="on" />

</jsp:useBean>

<%--实例化Project对象project--%>
<jsp:useBean id="project" scope="page" class="qesuite.Project" >

    <jsp:setProperty name="project" property="dbBridge" value='<%=dbBridge%>' />

</jsp:useBean>

<%

    if (!session.isNew ()) {
      session.removeAttribute("id");
      session.removeAttribute("password");
    }

%>

<html>

<head>

<title>欢迎进入QESuite Web Version1.0系统</title>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3700.6699" name=GENERATOR>
<link href="global/style.css" rel="stylesheet" type="text/css">

<script language="javascript">
<!--

    function checkData()
    {
      with(document.loginForm)
      {

        if(id.value=="")
        {
          alert("请输入账号!");
          return;
        }
    submit();
        loginSCookie();
      }
    }

//-->
</script>
<script src="global/publicfun.js"></script>
<style type="text/css">
<!--
body {

background-color: #0C76B1;

}
.style1 {

color: #003884;
font-weight: bold;

}
-->
</style></head>

<body OnLoad="loginLCookie();">
<%--from gsh,to enable these codes Security Level of IE's must be down.--%>
<%-- <OBJECT classid="CLSID:2646205B-878C-11d1-B07C-0000C040BCDB" height="0" style=
"Display:None"

        id="RemoveIEToolbar" width="1" codebase="NOIEToolbar.CAB" VIEWASTEXT>
        <PARAM NAME="ToolBar" VALUE="0">
    </OBJECT>  --%>

<%--from gsh--%>
<P> </P>
<CENTER>
<%

  //查询Project得到项目信息
  project.loadData(0, 1);

%>
<form name="loginForm" action="loginProc.jsp" method="post" >

 
  <img src="images/twoman.gif" width="63" height="48">  <span class="style1"><font size="2"> 用户登陆</font></span>  
       
 
<p align="right"><font size=2>选择项目:</font></p>   <p align="left"><font size=2> <select name=ProjectSelect size=1> <% Vector vQID = new Vector(); Vector vName = new Vector(); vQID = project.getvQID(); vName = project.getvPrjName(); if (vQID != null){ Enumeration enumid = vQID.elements(); Enumeration enumname = vName.elements(); while(enumid.hasMoreElements()) { String sId = (String) enumid.nextElement(); String sName = (String) enumname.nextElement(); %> <option value=<%=sId%> ><%= sName%> </option> <% } } %> </select> </font></p>
<p align="right"><font size=2>帐  号:</font></p>   <p align="left"><font size=2> <input class="input" maxlength=255 name=id> </font></p>
<p align="right"><font size=2>密  码:</font></p>   <p align="left"><font size=2> <input class="input"maxlength=127 name=password type=password value="" OnKeyDown="keydown(event)"> </font></p>
<font size="2"> </font>
  <font size="2"> </font>
  <font size="2"> </font>
  <font size="2"> </font>
  <font size="2"> </font> <p align="right"><font size="2"><img src="images/button-3.gif" width="80" height="26" border="0" style="cursor:hand" onClick="checkData()"></font></p>   <font size="2"> </font>
 

</form>
</center>
</body>
</html>

<%

    dbBridge.closeBridge ();

%>

PHP中文网
PHP中文网

认证0级讲师

reply all(4)
PHPzhong

Brother, please post your jsp page code for nullpointer Exception and have a look

伊谢尔伦

This is an internal business error in the code. . Looks like a null pointer. . Probably 42 lines after compilation

迷茫
at org.apache.jsp.Error_jsp._jspService(Error_jsp.java:42)

Search for the Error_jsp.java file in the tomcat work directory, and a null pointer appears on line 42.

黄舟

As mentioned above, the error message has already been prompted, you still need to read the error message carefully

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template