aspose file tools
The moose likes Java in General and the fly likes Can't Figure out why I get the cast error in this program at line 39 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Can Watch "Can New topic
Author

Can't Figure out why I get the cast error in this program at line 39

joe vasher
Ranch Hand

Joined: Nov 06, 2009
Posts: 37

I keep getting this error. I don't understand why this is happening? I included the error with my println statements which work right up to the read...

ANY help would be appreciate. I only have a few hairs left..

run:
Writing to file !0
Writing to file !1
Writing to file !2
here!
Packet created!
Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to com.pbuddie.Packet
at com.pbuddie.IOHandler.main(IOHandler.java:39)
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)



joe vasher
Ranch Hand

Joined: Nov 06, 2009
Posts: 37
Man it wasn't 3 secs after I posted this that I relized i didn't right the Packet file to disk..
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Can't Figure out why I get the cast error in this program at line 39
 
Similar Threads
Can I sit on ois.readObject() and wait for more packets? More questions
ObjectOutputStream -- Error.
Serialization in K&B
Serialization is not for static variables - Really true?
JTable challenge