tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6717] New: - Getting StringArrayOutOfBoundsException when trying to get client headers
Date Wed, 27 Feb 2002 13:22:30 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6717>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6717

Getting StringArrayOutOfBoundsException when trying to get client headers

           Summary: Getting StringArrayOutOfBoundsException when trying to
                    get client headers
           Product: Tomcat 3
           Version: 3.3 Final
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ofer@feathersys.com


Hi there,
I'm using your Tomcat3.3a version.
I wrote this Servlet:
public class TestRequestHeadersServlet extends HttpServlet 
{
	protected void service(HttpServletRequest req, HttpServletResponse resp)
                throws ServletException, java.io.IOException
	{
		Enumeration headersNames = req.getHeaderNames();
		
		while ( headersNames.hasMoreElements() )
		{
			String headerName = (String)headersNames.nextElement();
			String headerValue = req.getHeader( headerName );
			System.out.println( headerName + ":" + headerValue );
		}
	} 
}

which basically, as I understand, prints all client Http headers.
it works fine in most cases but when I'm using a client that sends these 
headers:
x-up-uplink:pcwap1.cellcom.co.il
x-up-fax-limit:100000
x-up-subno:1010498229-88004_pcwap1.cellcom.co.il
x-up-fax-accepts:text/plain, application/postscript, application/msword, 
application/rtf, application/pdf
host:212.179.27.151:8080
Accept-Language:en
User-Agent:SIE-S45/14 UP.Browser/5.0.1.1.102 (GUI) UP.Link/4.3.2
x-up-devcap-max-pdu:2800
x-up-devcap-charset:utf-8
Connection:Keep-Alive
Encoding-version:1.3
x-up-devcap-iscolor:0
x-up-fax-encodings:7bit, 8bit, base64, quoted-printable
Accept:application/vnd.wap.wmlc;Type=4365, application/vnd.wap.wmlc;Type=4360, 
application/vnd.wap.wmlc;Type=1108, application/vnd.wap.wmlc;Level=1.3, 
application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, 
application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.coc, 
application/vnd.uplanet.signal, application/vnd.uplanet.cacheop-wbxml, 
application/vnd.uplanet.alert-wbxml, application/vnd.uplanet.channel-wbxml, 
application/vnd.uplanet.list-wbxml, application/vnd.uplanet.listcmd-wbxml, 
application/vnd.uplanet.bearer-choice-wbxml, 
application/vnd.wap.multipart.related, application/vnd.wap.multipart.mixed, 
application/vnd.syncml-xml-wbxml, application/x-up-device, 
application/vnd.phonecom.mmc-wbxml;Type=4364, application/vnd.phonecom.mmc-
wbxml, application/vnd.phonecom.im, application/octet-stream, 
image/vnd.wap.wbmp, image/bmp, image/x-MS-bmp, audio/midi, audio/x-midi, 
audio/mid, text/x-vCalendar, text/x-vCard, application/x-
mmc.wallpaper;type=image/bmp;size=2000;gray=1;w=101;h=64, application/x-
mmc.ringtone;type=audio/midi;size=2000;voices=1, application/x-
mmc.title;charset=us-ascii;size=30, 
image/bmp,image/vnd.wap.wbmp,application/vnd.uplanet.alert,application/x-up-
alert,application/vnd.uplanet.bearer-
choice,application/vnd.uplanet.cacheop,application/x-up-
cacheop,application/vnd.uplanet.channel,application/vnd.uplanet.list,application
/vnd.uplanet.listcmd,application/vnd.phonecom.mmc-xml,text/x-
wap.wml,text/vnd.wap.wml,text/x-hdml,text/html,text/vnd.wap.wmlscript
x-up-devcap-numsoftkeys:2
x-up-devcap-gui:1
x-up-devcap-softkeysize:5
Accept-Charset:utf-8, UTF-8,

on the first two times i get this kind of response:
x-up-uplink:pcwap1.cellcom.co.il
x-up-fax-limit:100000
x-up-subno:1010498229-88004_pcwap1.cellcom.co.il
x-up-fax-accepts:text/plain, application/postscript, application/msword, 
application/rtf, application/pdf
host:212.179.27.151:8080
Accept-Language:en
User-Agent:SIE-S45/14 UP.Browser/5.0.1.1.102 (GUI) UP.Link/4.3.2
x-up-devcap-max-pdu:2800
x-up-devcap-charset:utf-8
Connection:Keep-Alive
Encoding-version:1.3
x-up-devcap-iscolor:0
x-up-fax-encodings:7bit, 8bit, base64, quoted-printable
2002-02-27 15:33:12 - Ctx() : Exception in R(  
+ /servlet/TestRequestHeadersServlet + null) - 
java.lang.StringIndexOutOfBoundsException: length must be >= 0
        at java.lang.String.<init>(String.java:362)
        at java.lang.String.<init>(String.java:411)
        at org.apache.tomcat.util.buf.ByteChunk.toString(Unknown Source)
        at org.apache.tomcat.util.buf.MessageBytes.toString(Unknown Source)
        at org.apache.tomcat.util.http.MimeHeaders.getHeader(Unknown Source)
        at org.apache.tomcat.core.Request.getHeader(Unknown Source)
        at org.apache.tomcat.facade.HttpServletRequestFacade.getHeader(Unknown 
Source)
        at TestRequestHeadersServlet.service(TestRequestHeadersServlet.java:19)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java)
        at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
        at org.apache.tomcat.core.Handler.invoke(Unknown Source)
        at org.apache.tomcat.core.Handler.service(Unknown Source)
        at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
        at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
        at org.apache.tomcat.core.ContextManager.service(Unknown Source)
        at org.apache.tomcat.modules.server.Http10Interceptor.processConnection
(Unknown Source)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
(Unknown Source)
        at java.lang.Thread.run(Thread.java:484)
-----------------------------------------------------
and after that it seems like working fine.

I'd appreciate any response.

Thanks,
Ofer

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message