Hi Paulo,

I'll take a look at the problem and let you know the result...

Thanks, Pavel
Forward. I already resolved it by serializing the string instead of
the file, but i thought you should know, if you don't already, why
people are seeing this exception on shutdown.


---------- Forwarded message ----------
From: Alan Bateman <[email protected]>
Date: Fri, Nov 13, 2009 at 9:53 AM
Subject: Re: Bug in ShellFolder.
To: Paulo Levi <[email protected]>
Cc: [email protected]


Paulo Levi wrote:
In this thread, i found a bug similar to a strange exception i was
(not) seeing when overriding writeObject

http://forums.java.net/jive/thread.jspa?threadID=31316&tstart=0

I found that it occurs because of saving files returned by the
filechooser (extensions of sun.awt.shell.ShellFolder) when trying to
serialize on a shutdownhook,
because serializing triggers some file operation that needs to send a
task to a Executor that is already closed.
I avoid it by:
out.writeObject(new File(((File) first).getAbsolutePath()));
Couldn't something equivalent be done in writeReplace be used for the
same thing inside one of those classes?


Sorry, I can't help you here - I would suggest bringing it up on one
of the Swing forums or mailing lists.

-Alan.

Reply via email to