problem in deserialization

Discussions

Web tier: servlets, JSP, Web frameworks: problem in deserialization

  1. problem in deserialization (1 messages)


     hi all
     its urgent.please any boyd can help me soon.
    i got stuck up with applet to servlet communication.
    in the servlet iam able to catch the values from data base.
    if iam trying to print it is printing the vector of values.
    then by using object output stream iam writing it to the
    applet. again in applet i opened urlconnection.then trying
    to read vector.i.e
    URL url = new URL("http://........");
    URLConnection uc = url.openConnection();

    InputStream in = uc.getOutputStream();
    //in the above line it is giving as stream corropted exception. it saying the input stream doesn't contain a valid input stream
    the
    Vector res = (Vector)in.readObject();

    thanx and regards.
    surendar reddy.suram

  2. problem in deserialization[ Go to top ]

    I would guess your problem is that uc.getOutputStream() returns an OutputStream, which is not a valid InputStream. Try changing it to:

    InputStream in = uc.getInputStream();

    Andy