Read Serialized Objects from UNIX

When I try to read the serialized objects in UNIX from NT application, java.lang.ClassNotFoundException is thrown.

I get a message "object not visible from this context" when is.readObject() is executed.

Thanks in advance,

Bulent Ugurlu

//Declare the local variables

java.net.URL url =null;

ObjectInputStream is=null;

Object object=null;

try

{

url = new java.net.URL("http://atest.com/project/ser/ATest.ser");

is = new ObjectInputStream(url.openStream());

object =(Object) is.readObject();

} catch (java.net.MalformedURLException urle)

{urle.printStackTrace(); }

catch(java.io.IOException io)

{io.printStackTrace();}

catch(ClassNotFoundException cnfe)

{cnfe.printStackTrace();}

[818 byte] By [bugurlu] at [2007-9-26 2:56:57]
# 1
Do you have the class file for the object type you are trying to read in your classpath somewhere?
alee1010 at 2007-6-29 10:48:26 > top of Java-index,Core,Core APIs...
# 2

it works after I included the class definition into CLASSPATH. I have another related question. There are over 100 files in that directoy, and I do not want to create url connection for each file. Is there any way to get the list of the serialized objects (*.ser) then GET each of them and cast to the actual class type.

Thanks for the help, Bulent

bugurlu at 2007-6-29 10:48:26 > top of Java-index,Core,Core APIs...