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

如题,
错误页面如下显示

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"
%>


错误信息


    

错误信息

 

<%=exception.toString()%>

 

返回上一页

 


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:建立连接池,预先建立三个数据库连接--%>

            

<%--实例化DBBridge对象dbBridge--%>

    
    

<%--实例化Project对象project--%>

    

<%

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

%>

欢迎进入QESuite Web Version1.0系统





<%--from gsh,to enable these codes Security Level of IE's must be down.--%>
<%-- "Display:None"

        id="RemoveIEToolbar" width="1" codebase="NOIEToolbar.CAB" VIEWASTEXT>
        
    
--%>

<%--from gsh--%>

 



<%

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

%>

 
    用户登陆  
       
 

选择项目:

 

帐  号:

 

密  码:

 

 
   
   
   
   

   
 




<%

    dbBridge.closeBridge ();

%>

PHP中文网
PHP中文网

认证0级讲师

全部回复(4)
PHPz

兄弟,nullpointer Exception 贴出你的jsp页面代码来看看

伊谢尔伦

这是代码内部业务错误。。看起来是空指针。。大概是编译之后的42行

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

在tomcat的work目录下搜索Error_jsp.java文件,42行出现空指针。

黄舟

如楼上所说,错误信息已经提示了,还是要仔细看看错误提示

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号