`
zoutuo1986
  • 浏览: 179164 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

Error finishing response ArrayIndexOutOfBoundsException 8192

阅读更多
Sep 10, 2016 10:45:15 AM org.apache.catalina.connector.CoyoteAdapter service
SEVERE: An exception or error occurred in the container during the request processing
java.lang.ArrayIndexOutOfBoundsException: 8192
        at org.apache.coyote.http11.AbstractOutputBuffer.write(AbstractOutputBuffer.java:522)
        at org.apache.coyote.http11.AbstractOutputBuffer.write(AbstractOutputBuffer.java:429)
        at org.apache.coyote.http11.AbstractOutputBuffer.sendHeader(AbstractOutputBuffer.java:395)
        at org.apache.coyote.http11.AbstractHttp11Processor.prepareResponse(AbstractHttp11Processor.java:959)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:739)
        at org.apache.coyote.Response.action(Response.java:170)
        at org.apache.coyote.Response.sendHeaders(Response.java:350)
        at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:315)
        at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:275)
        at org.apache.catalina.connector.Response.finishResponse(Response.java:501)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:420)
        at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:392)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:357)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1584)
        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)
Sep 10, 2016 10:45:15 AM org.apache.coyote.http11.AbstractHttp11Processor endRequest
SEVERE: Error finishing response
java.lang.ArrayIndexOutOfBoundsException
        at java.lang.System.arraycopy(Native Method)
        at org.apache.coyote.http11.AbstractOutputBuffer.write(AbstractOutputBuffer.java:491)
        at org.apache.coyote.http11.AbstractOutputBuffer.sendStatus(AbstractOutputBuffer.java:331)
        at org.apache.coyote.http11.AbstractHttp11Processor.prepareResponse(AbstractHttp11Processor.java:946)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:739)
        at org.apache.coyote.Response.action(Response.java:168)
        at org.apache.coyote.http11.AbstractOutputBuffer.endRequest(AbstractOutputBuffer.java:308)
        at org.apache.coyote.http11.InternalNioOutputBuffer.endRequest(InternalNioOutputBuffer.java:150)
        at org.apache.coyote.http11.AbstractHttp11Processor.endRequest(AbstractHttp11Processor.java:984)
        at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:433)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:357)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1584)
        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)

 

 tomcat 在 输出response之前, 需要sendHeader

如果 需要sendHeader的 信息 超过了8192,就会出现这个异常。

 

就我这边的问题而言,是response中的cookie内容太多了。

 

tomcat7.0.10

jdk1.6

 

处理的办法很简单,就是在结束之前竟可能的减少response中的cookie,或则修改tomcat的配置。

 

import      http://blog.csdn.net/miaoshuaiit/article/details/16879345

 

 

原因:

据说是Apache tomcat6的一个bug,需要增加maxHttpHeaderSize来处理。

tomcat的HttpHeaderSize默认值为8192,而你请求时超过了这个范围,可以修改这个这值已适应你的需求

 

解決方法:

Tomcat或JBoss的server.xml打开

指定maxHttpHeaderSize="8192"

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. <Connector port="8080" address="${jboss.bind.address}" maxThreads="250" maxHttpHeaderSize="8192"    
  2.   
  3.     emptySessionPath="true" protocol="HTTP/1.1"    
  4.   
  5.     enableLookups="false" redirectPort="8443" acceptCount="100"    
  6.   
  7.     connectionTimeout="20000" disableUploadTimeout="true" />    

例如:将maxHttpHeaderSize的值修改为:maxHttpHeaderSize="81920"

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics