关闭

[javax.servlet.ServletException: java.lang.NullPointerException]

7352人阅读 评论(0) 收藏 举报
分类:
2013-12-5 11:15:46 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [jsp] in context with path [/module-linkman] threw exception [javax.servlet.ServletException: java.lang.NullPointerException] with root cause
java.lang.NullPointerException
    at org.apache.tomcat.util.http.parser.HttpParser.parseMediaType(HttpParser.java:217)
    at org.apache.tomcat.util.http.parser.MediaTypeCache.parse(MediaTypeCache.java:54)
    at org.apache.catalina.connector.Response.setContentType(Response.java:805)
    at org.apache.catalina.connector.ResponseFacade.setContentType(ResponseFacade.java:245)
    at org.apache.jsp.pages.sgllinkman.addSglGroup_jsp._jspService(addSglGroup_jsp.java:61)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at com.chinaboxun.module.linkman.filter.SessionFilter.doFilter(SessionFilter.java:101)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:314)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)


情况是这样的,一个父页面index.jsp其中的page指令为:

XML/HTML code
?
1
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
子页面addSglGroup.jsp的page指令:
XML/HTML code
?
1
<%@ page language="java" contentType="text/html;" pageEncoding="UTF-8"%>

当点击打开这个子页面addSglGroup.jsp的时候提示上面贴出的错误。可把我找死了,利用删除代码各个排除的方法,发现了这个page指令有问题,果然去掉子页面的contentType="text/html;"过后页面正常打开了。原来以为是不能加contentType指令,到后来才知道原来这个指令里面不能加分号";"。



去掉contentType="text/html;"或者去掉分号contentType="text/html"就解决了




4
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:1027394次
    • 积分:10796
    • 等级:
    • 排名:第1575名
    • 原创:184篇
    • 转载:9篇
    • 译文:0篇
    • 评论:372条
    博客专栏
    最新评论