This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes java.io.StreamCorruptedException: invalid type code: 0D Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "java.io.StreamCorruptedException: invalid type code: 0D" Watch "java.io.StreamCorruptedException: invalid type code: 0D" New topic
Author

java.io.StreamCorruptedException: invalid type code: 0D

kannan coding
Greenhorn

Joined: Nov 19, 2008
Posts: 12
I am using the below code

public boolean checkUniqueness(ssg.net_pro.cables.CableRecord cr) throws Exception, java.rmi.RemoteException {

String mName = "checkUniqueness";
Class[] pType = { CableRecord.class };
Object[] pValue = { cr };

Object obj = getObject( new Serializable[] { mName, pType, pValue } );
return (obj != null) ? ((Boolean)obj).booleanValue() : false;
}

I got the StreamCorruptedException in the getObject line.

public Object getObject(Serializable[] objs, boolean cache) throws java.lang.Exception
{
DataProxyCache dpc = null;
Object obj = null;

if( cache ){
dpc = DataProxyCache.getInstance();
obj = dpc.getObject(objs);
}

if(obj == null){
ObjectInputStream in = postObjects(objs);
obj = in.readObject();
if( cache )
dpc.cacheObject(objs, obj);
in.close();
}

return(obj);
}

The inputStream is properly closed and i am returing the obj too. It was working these many days.
Now suddenly it's throwing exception as below

Save failed. Internal Error: java.io.StreamCorruptedException: invalid type code: 0D
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at ssg.eiu.rmiproxy.DataProxy.getObject(DataProxy.java:69)
at ssg.eiu.rmiproxy.DataProxy.getObject(DataProxy.java:47) at

Confused what does OD means here?
I tried restarting the server, but that too did not help.
Please provide your suggestions on this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.io.StreamCorruptedException: invalid type code: 0D