[jdom-interest] help! using ObjectInputStream in applet

Yilin Liu g8901 at cs.nccu.edu.tw
Thu Jun 28 00:40:12 PDT 2001


hi all, 
    I use ObjectInputStream to read Element object in applet.
    the sample codes is: 
         server:
                   out = new ObjectOutputStream(socket.getOutputStream());
                   out.writeObject((new Element("Test")).addAttribute("hello", "all");

         client:   Socket socket = new Socket(host, port);
                   in = new ObjectInputStream(socket.getInputStream());    
                   Element value = (Element)in.readObject();
    
    in runtime, I get the exception "java.io.InvalidClassException: java.util.ArrayList;             
                                                    IllegalAccessException
 at java/io/ObjectInputStream.initNewObject
 at java/io/ObjectInputStream.readNewObject
 at java/io/ObjectInputStream.readObject
 at com/ms/!!!Internal_Class_0.DefaultReadMethod
 at java/io/ObjectInputStream.invokeDefaultReadObject
 at java/io/ObjectInputStream.defaultReadObject
 at org/jdom/Element.readObject
 at java/io/ObjectInputStream.invokeReadObject
 at java/io/ObjectInputStream.readNewObject
 at java/io/ObjectInputStream.readObject
 at ClientThread.run" in jdom-b7.
    
    please tell me how to solve this problem??
    thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20010628/94497b56/attachment.htm


More information about the jdom-interest mailing list