When there is only one client then it is working fine. But If i have another browser or multiple clients working on this then I get the Stream corrupted Exception. The behaviour is inconsistent.
java.io.StreamCorruptedException: invalid stream header at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:767) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:283) at com.cts.dsf.agent.Server2Connection.getRuleMap(ServerAgent.java:390) at com.cts.dsf.agent.Server2Connection.run(ServerAgent.java:169) at java.lang.Thread.run(Thread.java:568) java.lang.NullPointerException at com.cts.dsf.agent.Server2Connection.run(ServerAgent.java:172) at java.lang.Thread.run(Thread.java:568)
Can anyone help me out to find what the problem is?
Thanks In advance.
Joined: Jan 29, 2003
Hi, welcome to the ranch!
In the future, use the "CODE" button below the post editor to insert tags that preserve your indenting. It's pretty hard to follow code that's all left justified like that.
That's a bit long to dig into. Do you have a good idea where things are going badly? It sounds like two threads might be sharing your reader. Any chance of that?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: May 30, 2007
Sorry for that. Will do that from the next posting.
The reader is initialized only after the thread is started. In that case ideally two threads will have two different reader to work with I guess.
I find this streamcorrupted exception caused when the ObjectInputStream is read from the server end.