Error parsing HTTP Request Header

Source: Internet
Author: User
Tags http request stack trace apache tomcat

Original address: http://www.w2bc.com/Article/15349

Parse English [pɑ:z] Beauty [Pɑ:rs]
Vt. (of words, phrases, etc.) from a grammatical description or analysis;

All definitions >> [Example] I ' m not going to the parse his statement. I'm not going to analyze his statement.

More examples >> past tense: parsed now participle: parsing past participle: parsed third person singular: parses

Tomcat throws an error when the Mobile client submits an HTTP request to the server:

December 31, 2014 2:32:45 pm Org.apache.coyote.http11.AbstractHttp11Processor Process
Info: Error parsing HTTP Request Header
Note:further occurrences of HTTP header parsing errors'll be logged at DEBUG level.

After debugging, it is found that Tomcat's header buffer size is not enough, only need to add the Maxhttpheadersize field in Server.xml:

<connector uriencoding= "UTF-8" port= "8080
	" protocol= "Org.apache.coyote.http11.Http11NioProtocol" Usebodyencodingforuri= "false"
	enablelookups= "false"
               connectiontimeout= "20000"
               redirectport= "8443" Maxhttpheadersize= "The size you want"/>

However, this problem does not occur with Web submissions, even if the phone repeatedly emphasizes the use of post, and is still suspected because the use of the get causes the header data to be too long.



============


I modified the following (by the way the port was changed from 8080 to 80), and then restarted with bin/shutdown.sh and bin/startup.sh:


<connector port= "protocol=" http/1.1 "

connectiontimeout= "20000"

Redirectport= "8443" maxhttpheadersize= "8192" uriencoding= "UTF-8"/>

<!--A "Connector" using the shared thread pool-->

<!--

<connector executor= "Tomcatthreadpool"

Port= "protocol=" http/1.1 "

connectiontimeout= "20000"

Redirectport= "8443" maxhttpheadersize= "8192" uriencoding= "UTF-8"/>

-

======================

But the shutdown and start execution is too fast and the seconds level is complete. Start the start command that waits a few minutes after the shutdown to enter. But it doesn't seem to really get up, the estimate is related to the database. It doesn't work after reboot. Guess whether you should listen to or close PostgreSQL before you perform Tomcat shutdown and startup.


[Root@david bin]#./shutdown.sh

Using catalina_base:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42

Using Catalina_home:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42

Using Catalina_tmpdir:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42/temp

Using Jre_home:/usr/java/jre1.8.0_45

Using CLASSPATH:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42/bin/bootstrap.jar:/lr62/liferay-portal-6.2-ce-ga4 /tomcat-7.0.42/bin/tomcat-juli.jar

[Root@david bin]#./startup.sh

Using catalina_base:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42

Using Catalina_home:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42

Using Catalina_tmpdir:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42/temp

Using Jre_home:/usr/java/jre1.8.0_45

Using CLASSPATH:/lr62/liferay-portal-6.2-ce-ga4/tomcat-7.0.42/bin/bootstrap.jar:/lr62/liferay-portal-6.2-ce-ga4 /tomcat-7.0.42/bin/tomcat-juli.jar

[Root@david bin]#
=============

Then the website comes out with the following information:


HTTP Status 500-java.lang.arrayindexoutofboundsexception:0

Type Exception Report

Message java.lang.arrayindexoutofboundsexception:0

Description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.servletexception:java.lang.arrayindexoutofboundsexception:0
	Com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter (invokerfilterchain.java:105)
	Com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter (invokerfilter.java:119)

Root cause

java.lang.arrayindexoutofboundsexception:0
	Com.liferay.portal.util.portalinstances._getdefaultcompanyid ( portalinstances.java:344)
	com.liferay.portal.util.PortalInstances.getDefaultCompanyId (Portalinstances.java : com.liferay.portal.util.PortalImpl.getDefaultCompanyId)
	(portalimpl.java:1909)
	Com.liferay.portal.util.PortalUtil.getDefaultCompanyId (portalutil.java:522)
	Com.liferay.portal.servlet.filters.validhostname.ValidHostNameFilter.doFilterTry (validhostnamefilter.java:38)
	Com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter ( invokerfilterchain.java:183)
	Com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter (invokerfilterchain.java:96)
	Com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter (invokerfilter.java:119)

Note the full stack trace of the root cause was available in the Apache tomcat/7.0.42 logs. Apache tomcat/7.0.42


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.