The "stale files" mechanism was added to help with problems that
occur, typically on Windows. On Windows if a file is open then the OS
prevents it from being deleted, as normally happens during an
undeployment or a redeployment. Such a "locked file" also prevents
removal of the directory tree which contains it.
To work around this, during a subsequent deployment of an app with the
same name - which therefore reuses the same directory in ${domainDir}/
applications - GlassFish tracks which files are "leftovers" from a
previous deployment. If a subsequent deployment delivers file of the
same name then the stale file tracking will no longer ignore that
file. The result should be that the stale file tracking remembers
only those files that were left over from a previous deployment but
were not part of the later deployment.
That's what the .glassfishStaleFiles is trying to accomplish.
It's not clear why so many JARs would be left open after an
undeployment. There is a bug reported recently which seems to be
caused by the web container is not currently updating the stale file
data. We're looking into that. But there might be something going on
here beyond that, perhaps (and this is just a guess) because you are
using an NFS.
- Tim
On Mar 13, 2012, at 10:09 AM, forums_at_java.net wrote:
> I've got an issue with Glassfish 3.1.1 having the domain created on
> a NFS.
> When undeploying any web application that has at least one jar file
> in the
> WEB-INF/lib directory, all jar files are left and
> a .glassfishStaleFiles is
> created.
> The .glassfishStaleFiles will contain a list of all jar files in the
> WEB-INF/lib directory.
> It seems that Glassfish still holds references to the jar files thus
> they're
> not removed.
> We have verified the issue on multiple variants of a NFS file system
> and it
> behaves similarily each time.
>
> We did not have this issue with Glassfish v2.x so it's something new
> with
> Glassfish 3.x
> Anyone else that has seen this?
> Any suggestion for remedy would be appreciated.
>
>
> --
>
> [Message sent by forum member 'DMoniX']
>
> View Post: http://forums.java.net/node/884236
>
>