By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

ClassNotFoundException reading object from ObjectInputStream

P: n/a
I have what I hope is a simple question:

I'm learning how to serialize objects. I create an ObjectOutputStream and
writeObject an object to it. I then create an ObjectInputStream and try to
readObject the object from it. readObject is failing with a
ClassNotFoundException. The class mentioned in the exception description is
in a JAR file listed in CLASSPATH. I know the class can be found because I
successfully create an object from the class and wrote it to the

Can anyone suggest why readObject can not find my class?

Thanks a lot.

David Liebtag
IBM APL Products and Services
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
More information:

My sequence of method calls works if I run it in a Java class. It does not
work if I call the sequence of methods through JNI.

I suspect that when a class is referenced in Java code, the JVM loads the
class and makes it available to the readObject deserialization process.
When I use the JNI FindClass API, the class is not made available to

Can anyone confirm this is true and perhaps suggest a work-around?

Is it not possible to deserialize objects from JNI code?

David Liebtag
IBM APL Products and Services
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.