Hi,
I wrote a couple of servlets and java serialization is adopted for the
communication between servlets.
I used following block of try{}catch{} statements just to check whether
the servlet received data either from the browser of another servlet.

try{
        InputStream is = req.getInputStream();
        log("got Input Stream");
 //ObjectInputStream reader = new
ObjectInputStream(req.getInputStream());
        ObjectInputStream reader = new ObjectInputStream(is);
        log("Object Input stream created");
        obj =reader.readObject();
        log("Got object from sports Servlet");
      }
      catch( java.io.StreamCorruptedException e)
      {
        log("Unable to receive object from Pservlet "+e.toString());
        log("Received data from the user- So proceed to process user's
request");
        //e.printStackTrace();
      }
      catch( java.lang.ClassNotFoundException e)
      {
         log("Class Not Found Exception ");
      }
   if (obj == null)
      {
            log("No object received from Sport servlet. So go and serve
the client");
           .......Do Some thing.
      }
else
{

  ......Do some thing
}

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.




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

Reply via email to