• Post Reply Bookmark Topic Watch Topic
  • New Topic

I am getting StreamCorruptedException  RSS feed

 
Joseph Bashir
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a .jsp file with method encrypt() to encrypt a string. This method works fine on my computer but when I upload it on the server, it throws this exception:

java.io.StreamCorruptedException

Can someone please help me solve this problem.

Here is the code to encrypt the string:



Thanks for the help.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps the serialized object file is not correct on the server. If you uploaded it via FTP, then perhaps you used text mode rather than image mode? Or perhaps the code is finding the wrong file (i.e., the file on the server is plain text, rather than the expect serialized object file).
 
Joseph Bashir
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have uploaded the file via FTP, and also have uploaded it using "Binary" Transfer type, but still there is the same problem. Any idea...

Thanks
 
Joseph Kampf
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code where you created the serialized Secret Key?

Keys are based on the implementation. Perhaps you don't have the right cipher suite in your classpath? Or maybe there is something in the way you are writing the serialized object.

Joe
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!