You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vincent Massol <vm...@octo.com> on 2001/12/21 15:44:59 UTC

[Tomcat 3.3] Strange behaviour w/ mixed POST/GET request

I have a strange behaviour in Tomcat 3.3 that does not happen either in
Tomcat 4.x or in Tomcat 3.2.x (or any other servlet engine for the
matter : Orion, Resin, WebLogic). It looks like voodoo for me and I have
trouble understanding what's happening.

I am sending several different HTTP requests (using HttpURLConnection)
to the server and depending on the order I get or do not get an error.
When I get the error, it is the typical :

Connection aborted by peer: JVM_recv in socket input stream read
java.net.SocketException: Connection aborted by peer: JVM_recv in socket
inp
ut stream read
   at java.net.SocketInputStream.socketRead(Native Method)

I am doing one special request in which I send _both_ GET parameters (in
the URL) and parameters in the request body (POST method). The other
requests are only GET requests.

If I call the mixed POST/GET request first, followed by the other GET
requests then everything is fine. However, if I start by doing on GET
request and then followed by the mixed POST/GET one, I get the
connection aborted by peer error.

Any idea ? Any known issues with mixed POST/GET requests ?

Thanks a lot for any hint as I'm beginning to tear my hair ... :-)
-Vincent



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request (NOT solved)

Posted by Vincent Massol <vm...@octo.com>.
I have spoken a bit too fast ... :-(

It worked 3 times in a row and then started failing again, same as
before. It failed even after removing all connection.disconnect() and
all close on streams related to the connection but the failure rate
seems to be lower ...

I've just run the tests 10 times and the result is :
Ok, ok, nok, ok, ok, ok, nok, nok, nok, nok

I've tried to write a sample test case to reproduce it but cannot (in
other words, it works all the time with the simple test case).

I'm a bit stuck and don't know what to do now ... Any idea ?
Thanks
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: 21 December 2001 17:27
> To: 'Tomcat Users List'
> Subject: RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> (solved)
> 
> I have found the reason ... My code was the equivalent of :
> 
> URL url = new
URL("http://localhost:8080/examples/snoop?param1=value1");
> HttpURLConnection connection =
(HttpURLConnection)url.openConnection();
> connection.setDoInput(true);
> connection.setDoOutput(true);
> connection.setUseCaches(false);
> connection.setRequestProperty("Content-type",
> "application/x-www-form-urlencoded");
> 
> PrintWriter out = new PrintWriter(connection.getOutputStream());
> out.print("param2=value2");
> out.close();
> connection.connect();
> connection.getInputStream().close();
> 
> And this throws an error. The problem is with the last line which
works
> fine with all other servlet engines but not Tomcat 3.3. If I change it
> to :
> 
> connection.disconnect();
> 
> it now works fine. This probably means that when the connection is
> closed it tries to close the underlying input stream and does not
verify
> if it is already closed (or something like this).
> 
> Thanks and sorry for the trouble.
> -Vincent
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol@octo.com]
> > Sent: 21 December 2001 16:15
> > To: 'Tomcat Users List'
> > Cc: 'Larry Isaacs'
> > Subject: RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET
request
> >
> >
> >
> > > -----Original Message-----
> > > From: ian silvester [mailto:ians@is2.co.uk]
> > > Sent: 21 December 2001 15:18
> > > To: Tomcat Users List
> > > Subject: Re: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET
> request
> > >
> > > Hmm.
> > >
> > > The fact that you only get this behaviour in 3.3 suggests very
> > strongly a
> > > problem in that release. Is there any reason why you can't use a
> > different
> > > release and avoid the error?
> > >
> >
> > Because in the framework I am working on (Jakarta Cactus), I need to
> > support all servlet engines (including Tomcat 3.3) :-)
> >
> > > That aside, I have seen this error under different circumstances -
> > doing a
> > > response.sendredirect in a JSP _after_ having already output HTML
to
> > the
> > > browser. For this to error is fair enough - its supposedly outside
> the
> > > HTTP
> > > spec. to send redirects after having started outputting HTML (in
> ASP,
> > MS
> > > being the hand-holders that they are, attempting to do this throws
a
> > > runtime
> > > error so as to avoid unexpected behaviour).
> > >
> > > Could your code be construed as doing something similar? If yes,
> then
> > you
> > > cannot guarantee that it will work on all combintaions of browser
> and
> > > server.
> > >
> >
> > There is no sendredirect in my code but I may be doing something not
> in
> > the spec ... As suggested by Larry Isaacs, I'm going to open a bug
in
> > bugzilla with details on the test case. However, it is going to take
> > some time as I need to extract the relevant portion from the code. I
> > hoped someone was going to say something like : "yes, we know, we
have
> > an issue when you're sending parameter in the URL at the same time
as
> in
> > the request body" ... :-)
> >
> > In the meantime (before I finish extracting the code), some more
> > information on the code logic (client side) :
> >
> > 1/ open an http connection to Tomcat 3.3 using HttpURLConnection and
> > read all returned data (with attached AutoReadHttpURLConnection
class)
> :
> >
> >   HttpURLConnection connection = helper.connect(theRequest);
> >   connection = new AutoReadHttpURLConnection(connection);
> >   // Trigger the transfer of data
> >   connection.getInputStream();
> >
> > On the server side, some code is executed and a result is set in the
> > application context.
> >
> > 2/ open a second connection to the server using HttpURLConnection
and
> > get the test result (sent back as an ObjectOutputStream)
> >
> > Repeat 1/ and 2/ for all the requests I mentioned in my previous
mail
> > (the mixed POST/GET one and the other GET ones).
> >
> > Thanks
> > -Vincent
> >
> > > ian
> > >
> > > ----- Original Message -----
> > > From: "Vincent Massol" <vm...@octo.com>
> > > To: <to...@jakarta.apache.org>
> > > Sent: Friday, December 21, 2001 2:44 PM
> > > Subject: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> > >
> > >
> > > > I have a strange behaviour in Tomcat 3.3 that does not happen
> either
> > in
> > > > Tomcat 4.x or in Tomcat 3.2.x (or any other servlet engine for
the
> > > > matter : Orion, Resin, WebLogic). It looks like voodoo for me
and
> I
> > have
> > > > trouble understanding what's happening.
> > > >
> > > > I am sending several different HTTP requests (using
> > HttpURLConnection)
> > > > to the server and depending on the order I get or do not get an
> > error.
> > > > When I get the error, it is the typical :
> > > >
> > > > Connection aborted by peer: JVM_recv in socket input stream read
> > > > java.net.SocketException: Connection aborted by peer: JVM_recv
in
> > socket
> > > > inp
> > > > ut stream read
> > > >    at java.net.SocketInputStream.socketRead(Native Method)
> > > >
> > > > I am doing one special request in which I send _both_ GET
> parameters
> > (in
> > > > the URL) and parameters in the request body (POST method). The
> other
> > > > requests are only GET requests.
> > > >
> > > > If I call the mixed POST/GET request first, followed by the
other
> > GET
> > > > requests then everything is fine. However, if I start by doing
on
> > GET
> > > > request and then followed by the mixed POST/GET one, I get the
> > > > connection aborted by peer error.
> > > >
> > > > Any idea ? Any known issues with mixed POST/GET requests ?
> > > >
> > > > Thanks a lot for any hint as I'm beginning to tear my hair ...
:-)
> > > > -Vincent
> > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe:
> > <ma...@jakarta.apache.org>
> > > > For additional commands:
> > <ma...@jakarta.apache.org>
> > > > Troubles with the list:
> > <ma...@jakarta.apache.org>
> > > >
> > > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe:
> <ma...@jakarta.apache.org>
> > > For additional commands:
> <ma...@jakarta.apache.org>
> > > Troubles with the list:
> <ma...@jakarta.apache.org>
> > >
> 
> 
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request (solved)

Posted by Vincent Massol <vm...@octo.com>.
I have found the reason ... My code was the equivalent of :

URL url = new URL("http://localhost:8080/examples/snoop?param1=value1");
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setUseCaches(false);
connection.setRequestProperty("Content-type",
"application/x-www-form-urlencoded");

PrintWriter out = new PrintWriter(connection.getOutputStream());
out.print("param2=value2");
out.close();
connection.connect();
connection.getInputStream().close();

And this throws an error. The problem is with the last line which works
fine with all other servlet engines but not Tomcat 3.3. If I change it
to :

connection.disconnect();

it now works fine. This probably means that when the connection is
closed it tries to close the underlying input stream and does not verify
if it is already closed (or something like this).

Thanks and sorry for the trouble.
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: 21 December 2001 16:15
> To: 'Tomcat Users List'
> Cc: 'Larry Isaacs'
> Subject: RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> 
> 
> 
> > -----Original Message-----
> > From: ian silvester [mailto:ians@is2.co.uk]
> > Sent: 21 December 2001 15:18
> > To: Tomcat Users List
> > Subject: Re: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET
request
> >
> > Hmm.
> >
> > The fact that you only get this behaviour in 3.3 suggests very
> strongly a
> > problem in that release. Is there any reason why you can't use a
> different
> > release and avoid the error?
> >
> 
> Because in the framework I am working on (Jakarta Cactus), I need to
> support all servlet engines (including Tomcat 3.3) :-)
> 
> > That aside, I have seen this error under different circumstances -
> doing a
> > response.sendredirect in a JSP _after_ having already output HTML to
> the
> > browser. For this to error is fair enough - its supposedly outside
the
> > HTTP
> > spec. to send redirects after having started outputting HTML (in
ASP,
> MS
> > being the hand-holders that they are, attempting to do this throws a
> > runtime
> > error so as to avoid unexpected behaviour).
> >
> > Could your code be construed as doing something similar? If yes,
then
> you
> > cannot guarantee that it will work on all combintaions of browser
and
> > server.
> >
> 
> There is no sendredirect in my code but I may be doing something not
in
> the spec ... As suggested by Larry Isaacs, I'm going to open a bug in
> bugzilla with details on the test case. However, it is going to take
> some time as I need to extract the relevant portion from the code. I
> hoped someone was going to say something like : "yes, we know, we have
> an issue when you're sending parameter in the URL at the same time as
in
> the request body" ... :-)
> 
> In the meantime (before I finish extracting the code), some more
> information on the code logic (client side) :
> 
> 1/ open an http connection to Tomcat 3.3 using HttpURLConnection and
> read all returned data (with attached AutoReadHttpURLConnection class)
:
> 
>   HttpURLConnection connection = helper.connect(theRequest);
>   connection = new AutoReadHttpURLConnection(connection);
>   // Trigger the transfer of data
>   connection.getInputStream();
> 
> On the server side, some code is executed and a result is set in the
> application context.
> 
> 2/ open a second connection to the server using HttpURLConnection and
> get the test result (sent back as an ObjectOutputStream)
> 
> Repeat 1/ and 2/ for all the requests I mentioned in my previous mail
> (the mixed POST/GET one and the other GET ones).
> 
> Thanks
> -Vincent
> 
> > ian
> >
> > ----- Original Message -----
> > From: "Vincent Massol" <vm...@octo.com>
> > To: <to...@jakarta.apache.org>
> > Sent: Friday, December 21, 2001 2:44 PM
> > Subject: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> >
> >
> > > I have a strange behaviour in Tomcat 3.3 that does not happen
either
> in
> > > Tomcat 4.x or in Tomcat 3.2.x (or any other servlet engine for the
> > > matter : Orion, Resin, WebLogic). It looks like voodoo for me and
I
> have
> > > trouble understanding what's happening.
> > >
> > > I am sending several different HTTP requests (using
> HttpURLConnection)
> > > to the server and depending on the order I get or do not get an
> error.
> > > When I get the error, it is the typical :
> > >
> > > Connection aborted by peer: JVM_recv in socket input stream read
> > > java.net.SocketException: Connection aborted by peer: JVM_recv in
> socket
> > > inp
> > > ut stream read
> > >    at java.net.SocketInputStream.socketRead(Native Method)
> > >
> > > I am doing one special request in which I send _both_ GET
parameters
> (in
> > > the URL) and parameters in the request body (POST method). The
other
> > > requests are only GET requests.
> > >
> > > If I call the mixed POST/GET request first, followed by the other
> GET
> > > requests then everything is fine. However, if I start by doing on
> GET
> > > request and then followed by the mixed POST/GET one, I get the
> > > connection aborted by peer error.
> > >
> > > Any idea ? Any known issues with mixed POST/GET requests ?
> > >
> > > Thanks a lot for any hint as I'm beginning to tear my hair ... :-)
> > > -Vincent
> > >
> > >
> > >
> > > --
> > > To unsubscribe:
> <ma...@jakarta.apache.org>
> > > For additional commands:
> <ma...@jakarta.apache.org>
> > > Troubles with the list:
> <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> >
> > --
> > To unsubscribe:
<ma...@jakarta.apache.org>
> > For additional commands:
<ma...@jakarta.apache.org>
> > Troubles with the list:
<ma...@jakarta.apache.org>
> >




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request

Posted by Vincent Massol <vm...@octo.com>.

> -----Original Message-----
> From: ian silvester [mailto:ians@is2.co.uk]
> Sent: 21 December 2001 15:18
> To: Tomcat Users List
> Subject: Re: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> 
> Hmm.
> 
> The fact that you only get this behaviour in 3.3 suggests very
strongly a
> problem in that release. Is there any reason why you can't use a
different
> release and avoid the error?
> 

Because in the framework I am working on (Jakarta Cactus), I need to
support all servlet engines (including Tomcat 3.3) :-)

> That aside, I have seen this error under different circumstances -
doing a
> response.sendredirect in a JSP _after_ having already output HTML to
the
> browser. For this to error is fair enough - its supposedly outside the
> HTTP
> spec. to send redirects after having started outputting HTML (in ASP,
MS
> being the hand-holders that they are, attempting to do this throws a
> runtime
> error so as to avoid unexpected behaviour).
> 
> Could your code be construed as doing something similar? If yes, then
you
> cannot guarantee that it will work on all combintaions of browser and
> server.
> 

There is no sendredirect in my code but I may be doing something not in
the spec ... As suggested by Larry Isaacs, I'm going to open a bug in
bugzilla with details on the test case. However, it is going to take
some time as I need to extract the relevant portion from the code. I
hoped someone was going to say something like : "yes, we know, we have
an issue when you're sending parameter in the URL at the same time as in
the request body" ... :-)

In the meantime (before I finish extracting the code), some more
information on the code logic (client side) :

1/ open an http connection to Tomcat 3.3 using HttpURLConnection and
read all returned data (with attached AutoReadHttpURLConnection class) :

  HttpURLConnection connection = helper.connect(theRequest);
  connection = new AutoReadHttpURLConnection(connection);
  // Trigger the transfer of data
  connection.getInputStream();

On the server side, some code is executed and a result is set in the
application context.

2/ open a second connection to the server using HttpURLConnection and
get the test result (sent back as an ObjectOutputStream)

Repeat 1/ and 2/ for all the requests I mentioned in my previous mail
(the mixed POST/GET one and the other GET ones).

Thanks
-Vincent

> ian
> 
> ----- Original Message -----
> From: "Vincent Massol" <vm...@octo.com>
> To: <to...@jakarta.apache.org>
> Sent: Friday, December 21, 2001 2:44 PM
> Subject: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> 
> 
> > I have a strange behaviour in Tomcat 3.3 that does not happen either
in
> > Tomcat 4.x or in Tomcat 3.2.x (or any other servlet engine for the
> > matter : Orion, Resin, WebLogic). It looks like voodoo for me and I
have
> > trouble understanding what's happening.
> >
> > I am sending several different HTTP requests (using
HttpURLConnection)
> > to the server and depending on the order I get or do not get an
error.
> > When I get the error, it is the typical :
> >
> > Connection aborted by peer: JVM_recv in socket input stream read
> > java.net.SocketException: Connection aborted by peer: JVM_recv in
socket
> > inp
> > ut stream read
> >    at java.net.SocketInputStream.socketRead(Native Method)
> >
> > I am doing one special request in which I send _both_ GET parameters
(in
> > the URL) and parameters in the request body (POST method). The other
> > requests are only GET requests.
> >
> > If I call the mixed POST/GET request first, followed by the other
GET
> > requests then everything is fine. However, if I start by doing on
GET
> > request and then followed by the mixed POST/GET one, I get the
> > connection aborted by peer error.
> >
> > Any idea ? Any known issues with mixed POST/GET requests ?
> >
> > Thanks a lot for any hint as I'm beginning to tear my hair ... :-)
> > -Vincent
> >
> >
> >
> > --
> > To unsubscribe:
<ma...@jakarta.apache.org>
> > For additional commands:
<ma...@jakarta.apache.org>
> > Troubles with the list:
<ma...@jakarta.apache.org>
> >
> >
> 
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 


Re: Question with request dispatchers?

Posted by Sarb Singh <si...@hotmail.com>.
I am trying Tomcat 4.

----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 21, 2001 11:37 AM
Subject: Re: Question with request dispatchers?


>
>
> On Fri, 21 Dec 2001, Sarb Singh wrote:
>
> > Date: Fri, 21 Dec 2001 11:20:48 -0600
> > From: Sarb Singh <si...@hotmail.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: Tomcat Users List <to...@jakarta.apache.org>
> > Subject: Question with request dispatchers?
> >
> > Hello I have the following question about resquest dispatcher .include
> > /forward  methods.
> >
> > I have  a servlets (lets call it S)  that uses the dispatcher to forward
the
> > requequest to a JSP (lets call it (J)). This has Jsp uses a tag library
> > (lets calle it T) that uses the dispatcher to inlcude another JSP page
> > (lests call it J2).
> >
> > When you use the the dispatch include, when i set request attrribute in
the
> > included JSP2 file, these valued disappera when the control goes back to
the
> > JSP1 file.
> >
> > Can attributes be set to the request object from the included page that
will
> > be visible to the including page, or is the request of the included page
a
> > new indipendent request.
> >
> > Here is a summary of what I said.
> >
> > S--forwards--> J - has T ---- includes--> J2.
> >
> > If I set attributes in the request object from J2, will i be able to see
> > those attribute values from J or T?
> >
>
> Which version of Tomcat are you using?  You are correct in assuming that
> this should work, and it does in Tomcat 4.
>
> Craig
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Question with request dispatchers?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 21 Dec 2001, Sarb Singh wrote:

> Date: Fri, 21 Dec 2001 11:20:48 -0600
> From: Sarb Singh <si...@hotmail.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Question with request dispatchers?
>
> Hello I have the following question about resquest dispatcher .include
> /forward  methods.
>
> I have  a servlets (lets call it S)  that uses the dispatcher to forward the
> requequest to a JSP (lets call it (J)). This has Jsp uses a tag library
> (lets calle it T) that uses the dispatcher to inlcude another JSP page
> (lests call it J2).
>
> When you use the the dispatch include, when i set request attrribute in the
> included JSP2 file, these valued disappera when the control goes back to the
> JSP1 file.
>
> Can attributes be set to the request object from the included page that will
> be visible to the including page, or is the request of the included page a
> new indipendent request.
>
> Here is a summary of what I said.
>
> S--forwards--> J - has T ---- includes--> J2.
>
> If I set attributes in the request object from J2, will i be able to see
> those attribute values from J or T?
>

Which version of Tomcat are you using?  You are correct in assuming that
this should work, and it does in Tomcat 4.

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Question with request dispatchers?

Posted by Sarb Singh <si...@hotmail.com>.
Hello I have the following question about resquest dispatcher .include
/forward  methods.

I have  a servlets (lets call it S)  that uses the dispatcher to forward the
requequest to a JSP (lets call it (J)). This has Jsp uses a tag library
(lets calle it T) that uses the dispatcher to inlcude another JSP page
(lests call it J2).

When you use the the dispatch include, when i set request attrribute in the
included JSP2 file, these valued disappera when the control goes back to the
JSP1 file.

Can attributes be set to the request object from the included page that will
be visible to the including page, or is the request of the included page a
new indipendent request.

Here is a summary of what I said.

S--forwards--> J - has T ---- includes--> J2.

If I set attributes in the request object from J2, will i be able to see
those attribute values from J or T?

Thanks




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request

Posted by Vincent Massol <vm...@octo.com>.

> -----Original Message-----
> From: ian silvester [mailto:ians@is2.co.uk]
> Sent: 21 December 2001 15:18
> To: Tomcat Users List
> Subject: Re: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> 
> Hmm.
> 
> The fact that you only get this behaviour in 3.3 suggests very
strongly a
> problem in that release. Is there any reason why you can't use a
different
> release and avoid the error?
> 

Please also note that it seems to happen only on some platforms. For
example it works on RedHat Linux w/JDK 1.3.1_01 (this is the platform
which is hosting GUMP and the tests are run every night with Tomcat 3.3
- see
http://jakarta.apache.org/builds/gump/latest/jakarta-cactus-22.html),
but seems to fail on SunOS w/JDK 1.3.1_01 (not verified myself, I was
told). It also fails on my platforms, which are Windows 2000 / Windows
XP with JDK 1.3.1_01

Thanks
-Vincent

> That aside, I have seen this error under different circumstances -
doing a
> response.sendredirect in a JSP _after_ having already output HTML to
the
> browser. For this to error is fair enough - its supposedly outside the
> HTTP
> spec. to send redirects after having started outputting HTML (in ASP,
MS
> being the hand-holders that they are, attempting to do this throws a
> runtime
> error so as to avoid unexpected behaviour).
> 
> Could your code be construed as doing something similar? If yes, then
you
> cannot guarantee that it will work on all combintaions of browser and
> server.
> 
> ian
> 
> ----- Original Message -----
> From: "Vincent Massol" <vm...@octo.com>
> To: <to...@jakarta.apache.org>
> Sent: Friday, December 21, 2001 2:44 PM
> Subject: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request
> 
> 
> > I have a strange behaviour in Tomcat 3.3 that does not happen either
in
> > Tomcat 4.x or in Tomcat 3.2.x (or any other servlet engine for the
> > matter : Orion, Resin, WebLogic). It looks like voodoo for me and I
have
> > trouble understanding what's happening.
> >
> > I am sending several different HTTP requests (using
HttpURLConnection)
> > to the server and depending on the order I get or do not get an
error.
> > When I get the error, it is the typical :
> >
> > Connection aborted by peer: JVM_recv in socket input stream read
> > java.net.SocketException: Connection aborted by peer: JVM_recv in
socket
> > inp
> > ut stream read
> >    at java.net.SocketInputStream.socketRead(Native Method)
> >
> > I am doing one special request in which I send _both_ GET parameters
(in
> > the URL) and parameters in the request body (POST method). The other
> > requests are only GET requests.
> >
> > If I call the mixed POST/GET request first, followed by the other
GET
> > requests then everything is fine. However, if I start by doing on
GET
> > request and then followed by the mixed POST/GET one, I get the
> > connection aborted by peer error.
> >
> > Any idea ? Any known issues with mixed POST/GET requests ?
> >
> > Thanks a lot for any hint as I'm beginning to tear my hair ... :-)
> > -Vincent
> >
> >
> >
> > --
> > To unsubscribe:
<ma...@jakarta.apache.org>
> > For additional commands:
<ma...@jakarta.apache.org>
> > Troubles with the list:
<ma...@jakarta.apache.org>
> >
> >
> 
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 




--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request

Posted by ian silvester <ia...@is2.co.uk>.
Hmm.

The fact that you only get this behaviour in 3.3 suggests very strongly a
problem in that release. Is there any reason why you can't use a different
release and avoid the error?

That aside, I have seen this error under different circumstances - doing a
response.sendredirect in a JSP _after_ having already output HTML to the
browser. For this to error is fair enough - its supposedly outside the HTTP
spec. to send redirects after having started outputting HTML (in ASP, MS
being the hand-holders that they are, attempting to do this throws a runtime
error so as to avoid unexpected behaviour).

Could your code be construed as doing something similar? If yes, then you
cannot guarantee that it will work on all combintaions of browser and
server.

ian

----- Original Message -----
From: "Vincent Massol" <vm...@octo.com>
To: <to...@jakarta.apache.org>
Sent: Friday, December 21, 2001 2:44 PM
Subject: [Tomcat 3.3] Strange behaviour w/ mixed POST/GET request


> I have a strange behaviour in Tomcat 3.3 that does not happen either in
> Tomcat 4.x or in Tomcat 3.2.x (or any other servlet engine for the
> matter : Orion, Resin, WebLogic). It looks like voodoo for me and I have
> trouble understanding what's happening.
>
> I am sending several different HTTP requests (using HttpURLConnection)
> to the server and depending on the order I get or do not get an error.
> When I get the error, it is the typical :
>
> Connection aborted by peer: JVM_recv in socket input stream read
> java.net.SocketException: Connection aborted by peer: JVM_recv in socket
> inp
> ut stream read
>    at java.net.SocketInputStream.socketRead(Native Method)
>
> I am doing one special request in which I send _both_ GET parameters (in
> the URL) and parameters in the request body (POST method). The other
> requests are only GET requests.
>
> If I call the mixed POST/GET request first, followed by the other GET
> requests then everything is fine. However, if I start by doing on GET
> request and then followed by the mixed POST/GET one, I get the
> connection aborted by peer error.
>
> Any idea ? Any known issues with mixed POST/GET requests ?
>
> Thanks a lot for any hint as I'm beginning to tear my hair ... :-)
> -Vincent
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>