日期:2014-05-18  浏览次数:20966 次

Tomcat运行一段时间出现 MimeHeaders.setValue MimeHeaders.clear 空指针异常!什么原因造成的呢?

只有红色部分是我的代码.但看了对应的代码,根本没什么问题!
而且是运行一段时间Tomcat才会报这样的错误.
出现这个错误以后刷新页面有的时候好时.有的时候会出现白页.

网上找了一下有人跟我遇到同样的问题,但都没有解决办法.

LogoAlarmAction.java 22,23行:
Java code
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");


ActionBase.java:310,311行
Java code

map = new CastMap((Map) indata.getMap());
strRlt = this.invoke(map, userinfo,request);




--------------------------------------------
2008-10-22 12:01:05 org.apache.coyote.http11.Http11Processor process
严重: Error finishing response
java.lang.NullPointerException
  at org.apache.tomcat.util.http.MimeHeaders.setValue(MimeHeaders.java:267
)
  at org.apache.coyote.http11.Http11Processor.prepareResponse(Http11Proces
sor.java:1509)
  at org.apache.coyote.http11.Http11Processor.action(Http11Processor.java:
934)
  at org.apache.coyote.Response.action(Response.java:181)
  at org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutp
utBuffer.java:379)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:879)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:634)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
5)
  at java.lang.Thread.run(Thread.java:619)
2008-10-22 12:01:05 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand
ler process
严重: Error reading request, ignored
java.lang.NullPointerException
  at org.apache.tomcat.util.http.MimeHeaders.clear(MimeHeaders.java:130)
  at org.apache.coyote.Response.recycle(Response.java:579)
  at org.apache.coyote.http11.InternalOutputBuffer.nextRequest(InternalOut
putBuffer.java:349)
  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:901)
  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:634)
  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
5)
  at java.lang.Thread.run(Thread.java:619)
java.lang.NullPointerException
  at org.apache.tomcat.util.http.MimeHeaders.setValue(MimeHeaders.java:267
)
  at org.apache.coyote.Response.setHeader(Response.java:330)
  at org.apache.catalina.connector.Response.setHeader(Response.java:1295)
  at org.apache.catalina.connector.ResponseFacade.setHeader(ResponseFacade
.java:480)
at com.project.wonweb.alarm.LogoAlarmAction.invoke(LogoAlarmAction.java
:23)
at com.project.framework.struts12.action.ActionBase.execute(ActionBase.
java:311)
  at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:431)
  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:236)
  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:119
6)
  at org.apache.struts.action.ActionSe