Maybe someone can help me.
I am running tomcat 3.2.1 server on Sun Solaris 2.7. One of my
servlets is using javamail package to assemble and send e-mails. The
e-mail fields are passed to the server as request parameters, so the
code looks like this:
Message msg = new MimeMessage(session);
msg.setFrom(new
InternetAddress(request.getParameter("from")));
msg.setTo(new InternetAddress(request.getParameter("to")));
msg.setSubject(request.getParameter("subject"));
msg.setText(request.getParameter("body"));
Transport.send(msg);
If I attempt attempt to send a message with the size greater than 2048
as soon as I start the server, I get the following exception:
2002-09-10 05:03:58 - ContextManager: Error reading request, ignored -
java.lang.ArrayIndexOutOfBoundsException: 2048
at org.apache.tomcat.service.http.HttpRequestAdapter.parseHeaderFiled(Compiled
Code)
at org.apache.tomcat.service.http.HttpRequestAdapter.readHeaders(Compiled
Code)
at org.apache.tomcat.service.http.HttpRequestAdapter.readNextRequest(Compiled
Code)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Compiled
Code)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled
Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled
Code)
at java.lang.Thread.run(Compiled Code)
However, if I (successfully) send a smaller message first, then later
I am able to send the larger message (>2048) as well.
What causes this? How to avoid getting the exception in the first
place.
Thanks for any input.