Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid Stream Header (?) - Please help  RSS feed

 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While running my code, I get an IOException with the details "invalid stream header". The thing is that the code runs with no exception on my PC and with the exception on another PC.

How should I go about debugging it?

Thank you!
Rachel



try{
keyStore = KeyStore.getInstance("JCEKS", "SunJCE");
if(!store.exists()){
keyStore.load(null, storePass);
store.createNewFile();
storein = new FileInputStream(store);
}else{
//System.out.println("Store exist.");
storein = new FileInputStream(store);
keyStore.load(storein, storePass);
}
storeout = new FileOutputStream(storeName, true);

}catch (FileNotFoundException ioe){
throw new SSException ("FileNotFoundException: "+ioe.getMessage());
}catch (IOException ioe){
throw new SSException("IOException: "+ioe.getMessage());
}catch (NoSuchProviderException ioe){
throw new SSException ("NoSuchProviderException: "+ioe.getMessage());
}catch (KeyStoreException ioe){
throw new SSException ("KeyStoreException: "+ioe.getMessage());
}catch (NoSuchAlgorithmException ioe){
throw new SSException ("NoSuchAlgorithmException: "+ioe.getMessage());
}catch (CertificateException ioe){
throw new SSException ("CertificateException: "+ioe.getMessage());
}catch (Exception ioe){
throw new SSException ("Store error: "+ioe.getMessage());
}
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!