The message is:
Exception Occurred: Error occurred during deployment: There is no installed container capable of handling this application [your app name].
One solution (assuming you know your WAR file is valid) is to check for a hidden file in the deployment folder for your application:
/path/to/glassfish/domains/domain1/applications/yourappname/.glassfishStaleFiles
What is this “stale files” file all about?
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.
The solution is to delete the .glassfishStaleFiles
file, and re-deploy your application. This has happened to me about twice in 2 years - which is why it has taken me a moment to remember, each time it has happened.
The article suggests this is primarily a Windows issue - but it can happen elsewhere. For me it happened on Linux due to a sporadically unstable NFS configuration.
Contents of the stale files file - here is an example:
-rw-rw-r-- 1 b in 1170 Mar 29 20:09 .glassfishStaleFiles
drwxrwxr-x 3 b in 1024 Mar 29 20:09 WEB-INF
$ more .glassfishStaleFiles
WEB-INF/
WEB-INF/lib/
WEB-INF/lib/.nfs0000000000099114000005cd
WEB-INF/lib/.nfs00000000000ec64d000005e8
WEB-INF/lib/.nfs00000000000ec64c000005e7
WEB-INF/lib/.nfs00000000000ec64b000005e6
WEB-INF/lib/.nfs00000000000ec64a000005e5
WEB-INF/lib/.nfs00000000000ec649000005e4
WEB-INF/lib/.nfs00000000000ec648000005e3
WEB-INF/lib/.nfs00000000000ec647000005e2
WEB-INF/lib/.nfs00000000000ec646000005e1
WEB-INF/lib/.nfs00000000000ec645000005e0
WEB-INF/lib/.nfs00000000000ec644000005df
WEB-INF/lib/.nfs00000000000ec643000005de
WEB-INF/lib/.nfs00000000000ec641000005dd
WEB-INF/lib/.nfs00000000000ec640000005dc
WEB-INF/lib/.nfs0000000000099123000005db
WEB-INF/lib/.nfs0000000000099122000005da
WEB-INF/lib/.nfs0000000000099121000005d9
WEB-INF/lib/.nfs0000000000099120000005d8
WEB-INF/lib/.nfs000000000009911f000005d7
WEB-INF/lib/.nfs000000000009911e000005d6
WEB-INF/lib/.nfs000000000009911d000005d5
WEB-INF/lib/.nfs000000000009911c000005d4
WEB-INF/lib/.nfs000000000009911b000005d3
WEB-INF/lib/.nfs000000000009911a000005d2
WEB-INF/lib/.nfs0000000000099119000005d1
WEB-INF/lib/.nfs0000000000099118000005d0
WEB-INF/lib/.nfs0000000000099117000005cf
WEB-INF/lib/.nfs0000000000099115000005ce