You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jason C Jones <jc...@iastate.edu> on 2000/12/19 18:08:30 UTC

IllegalStateException: Short Read while trying to do forward()

I am running 3.2.1 in standalone mode and when I try to do a forward with a 
RequestDispatcher I get the following error:

going to /patient.jsp
res.isCommitted() = false
res.getBufferSize() = 8192
2000-12-19 04:53:48 - Ctx( /nativeweb ): Exception in: R( /nativeweb + /patient.
jsp + null) - java.lang.IllegalArgumentException: Short Read
        at javax.servlet.http.HttpUtils.parsePostData(HttpUtils.java:238)
        at org.apache.tomcat.util.RequestUtil.readFormData(RequestUtil.java:101)


Note the two debugging lines above the exception.  According to the specs, an 
IllegalArgumentException is thrown when the response is already committed, 
which it is not as you can see.

Is this a bug?  The servlet in question uses HttpUtil.parsePostData to read the 
post data and inflate a bean.  It then puts the bean into the session object 
and tries to redirect to a jsp for display.  

Anyone have any ideas?

Thanks,

Jason


---
Jason C. Jones
jcjones@iastate.edu


Re: IllegalStateException: Short Read while trying to do forward()

Posted by Stephen Coy <st...@optushome.com.au>.
G'Day,

on 20/12/00 4:08 AM, Jason C Jones at jcjones@iastate.edu wrote:

> I am running 3.2.1 in standalone mode and when I try to do a forward with a
> RequestDispatcher I get the following error:
> 
> going to /patient.jsp
> res.isCommitted() = false
> res.getBufferSize() = 8192
> 2000-12-19 04:53:48 - Ctx( /nativeweb ): Exception in: R( /nativeweb +
> /patient.
> jsp + null) - java.lang.IllegalArgumentException: Short Read
> at javax.servlet.http.HttpUtils.parsePostData(HttpUtils.java:238)
> at org.apache.tomcat.util.RequestUtil.readFormData(RequestUtil.java:101)
> 
> 
> Note the two debugging lines above the exception.  According to the specs, an
> IllegalArgumentException is thrown when the response is already committed,
> which it is not as you can see.
> 
> Is this a bug?  The servlet in question uses HttpUtil.parsePostData to read
> the 
> post data and inflate a bean.  It then puts the bean into the session object
> and tries to redirect to a jsp for display.
> 
> Anyone have any ideas?
> 

I'm going to take a stab at the obvious here (at least to me). You seem to
be confusing the IllegalArgumentException with IllegalStateException. I
don't think that your assertion that "According to the specs, an
IllegalArgumentException is thrown when the response is already committed"
is quite right. I'm pretty sure that it says "Illegal *State* Exception".

I suspect that you are passing a bad argument to your bean inflation code,
and this is causing the "Illegal *Argument* Exception".

Regards,

Steve Coy