> How did you write the stream? e.g. did you know you can't append
> ObjectOutputStreams?
Here's the code:
KeyGenerator keygen = KeyGenerator.getInstance("DES");
key = keygen.generateKey();
FileOutputStream fos = new FileOutputStream(deskey_file);
ObjectOutputStream keyFile = new ObjectOutputStream(fos);
keyFile.writeObject(key);
keyFile.close();
fos.close();
As you can see I don't write in append mode.
The strange thing is that I'm able to successfully load the keyFile
from a command-line program but NOT from the ServletContextListener.
Thanks in advance
Flavio
Daniel Pitts - 30 Jul 2007 17:17 GMT
On Jul 30, 12:31 am, Flavio Castelli <flavio.caste...@gmail.com>
wrote:
> > How did you write the stream? e.g. did you know you can't append
> > ObjectOutputStreams?
[quoted text clipped - 16 lines]
> Thanks in advance
> Flavio
Are you using an absolute path or a relative path?
Have you tried using ClassLoader.getResourceAsStream()?