Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ObjectInputStrem.readObject gets stuck

843810Sep 8 2004 — edited Sep 16 2004
Hi,

i'm facing a bad problem with my serialization. I have a serialized file that came with an open source project. When i access this file with classes from the package, it works fine, but when i import these classes into my workspace - i'm using eclipse 3.0 - every gets stuck at the readObject() call.

final InputStream in=Unit.class.getClassLoader().getResourceAsStream(UnitSet.PATHNAME);
if (in!=null) try {
final ObjectInputStream oin=new ObjectInputStream(in);
final Unit[] units=(Unit[]) oin.readObject();
oin.close();
/*
* Appelle 'intern()' simplement par pr�caution.
* En principe, ce n'est pas n�cessaire.
*/
for (int i=0; i<units.length; i++) {
units=units[i].intern();
}
return units;
} catch (Exception exception) {
exception.printStackTrace();
}
return null;
}

Has anyone any idea why this happens? Any help would be great!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2004
Added on Sep 8 2004
2 comments
177 views