HI
Your comments makes sense. But..
In our design we have multi-layer servlets. And, we are using Java Onject
only in one case and the entry poing to end users is a query string. Java
onject comes from servlets from the down the layers. Also, we are checking
whether we received any java object or not. If it is not java object then
only we go for req.getparameter() otherwise some other routine will take
care of java object. Also, this architecure is working fine with JRUN and
ServletExec.

Hemchand.

-----Original Message-----
From: Jon Stevens [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 10, 2000 2:40 PM
To: Java-Servlets
Subject: Re: Serialization in JSev servlets.


on 10/10/2000 2:15 PM, "Aluru, HemachandX" <[EMAIL PROTECTED]>
wrote:

> This works fine under JRUN and ServletExec. Under Apachi JServ the
> servlet gets hanges as soon as it reaches to the instruction
> ObjectInputStream reader = new ObjectInputStream(is); After a long
> pause, it enter else condition and no trace of servlet execution.
> 
> What could be the reason. Same code works on other servlet engines. The
> complete code is compiled under JDK1.2 and JSDK2.0.
> 
> Thanks
> Hemchand.

Ok, I just looked at your code more closely and ouch...you are doing
something really messed up in concept...here is why...

Has anything else already read from req.getInputStream()?

Have you called req.getParameter*() at all?

If so, then that is your problem. Once you call req.getIS or req.getP*, you
can't read from the input stream again as it has already been read and the
data doesn't exist.

The "right" way to do what you want to do is to simply make a thread in your
servlet that "listens" to requests on a IP/Port.

You are overloading the purpose of getInputStream() (which is really just
for get/post/fileupload data) and not for object byte[] data.

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/




------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:       [EMAIL PROTECTED]




------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:       [EMAIL PROTECTED]

Reply via email to