• Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception documentation required

 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone let me know under what circumstances java.io.UTFDataFormatException exception will be thrown?
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the API?
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link, I read the API but below given was the thrown StackTrace, so can you help me now?

[ February 20, 2004: Message edited by: Ketan Chachad ]
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, you want to know why a specific exception is being thrown and not just in general.
I don't think we'd be able to help you without being able to see the code that's causing the exception in the first place. If you could provide that, we should hopefully be able to pinpoint your problem
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're reading serialized objects, right? I'm guessing that there's a mismatch between how you write the object and how you read it. You should probably show us the code that writes the object as well as the code that reads it.
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok here is the code that serializes the object

Here class GZipMailFile is the class whose instance is serialized. And the code that reads the object is as follows:

Now can you help me?
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any obvious problem - the code looks good. I would try testing some simplified code to see if that can provide clues. For example, try removing the GZIP classes from the processes - temporarily, just for testing. Does that affect the error at all? And it looks like you are sending the file as an attachment in mail. What happens if you try to read the GZipMailFile from the file immediately after writing it? If you can read the file without errors, that would be a clue that maybe the problem is somewhere in your emailing code instead. Perhaps there's something there which is causing data corruption.
 
Ketan KC Chachad
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also need some help on an error I am encountering while using CheckedOutputStream, CheckedInputStream, ZipOutputStream and ZipInputStream. Can anyone give me some links or should I present my problem here?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!