Tomcat 或JBOSS java.lang.ArrayIndexOutOfBoundsException: 8192原因及其解决方法

tomcat下,当
  StringWriter sw = new StringWriter();
                    PrintWriter pw = new PrintWriter(sw);
                    e.printStackTrace(pw);

是,出现错误:
严重: An exception or error occurred in the container during the request processing 
java.lang.ArrayIndexOutOfBoundsException: 8192

解决方法:
据说是Apache tomcat6的一个bug,需要增加maxHttpHeaderSize来处理。

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

解決方法:

Tomcat或JBoss的server.xml打开

指定maxHttpHeaderSize="81920"

猜你喜欢

转载自jackyrong.iteye.com/blog/2230659