On (my) Windows QuickLook fails 100% of the time with one failure .
Here is what is happening:
(0) There is an empty (zero-byte) local-password file in the domain's config directory and the domain is definitely running.
(1) restart-domain is a subclass of StopDomain. StopDomain.executeCommand() sees that there is no valid local-password
(2) by DEFINITION, (1) means that the domain is NOT running.
(3) So now asadmin thinks that there is no DAS running – so it tries the improvement that was added --> start the domain
(4) (3) is done inside RestartDomain's dasNotRunning() method. It calls start-domain
(5) start-domain detects that its admin port is in use – and fails because of that.
Result – impossible to restart the running DAS without a forcible OS-level kill. It can not be restarted locally. It can not be stopped locally the normal way.
Question: What happened to the local-password file? Unknown. I didn't look into that. QL tests are hostile to debugging – it takes forever.
But this is a good bug that QL uncovered. This behavior is bad. It is fragile (brittle?). stopdomain shouldn't merely look for the magic file. It ought to also check and see if the admin port is in use. If so – it can call the _localdirectories(sp?) command on that port and see if it REALLY is the domain. Then emit a severe/warning message about the weird empty local password file.
Another EASY way to reproduce this bug –
1) start a domain
2) edit the local-password file. Make it empty and save it
restart-domain --kill is NOT working:
D:\glassfish3\glassfish\domains\domain1\config>asadmin restart-domain --kill
Server is not running, will attempt to start it...
There is a process already using the admin port 4848 – it probably is another instance of a GlassFish server.
Restart domain failed. expected:<true> but was:<false>
23 lines not shown