[jdom-interest] help! using ObjectInputStream in applet
Guy Nirpaz
guyn at tantian.com
Thu Jun 28 04:07:08 PDT 2001
Hello,
If you're using a browser without plug-in i.e. IExplorer, than the
runtime environment is JDK 1.1.
Collections (java.util.ArrayList) where introduced starting from JDK
1.2.
You should either build with build1.1, and add the collections.jar to
the jar file loaded by the applet, use 1.2 plug-in as your applet
runtime environment.
- Guy
-----Original Message-----
From: Yilin Liu [mailto:g8901 at cs.nccu.edu.tw]
Sent: Thu, June 28, 2001 9:40 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] help! using ObjectInputStream in applet
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.
More information about the jdom-interest
mailing list