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]

Reply via email to