I'm not sure what exact message I'd expect to see in my scenario. Your comments and messages back to user are more helpful I think than what user currently sees, and are on the right track of what I'd expect and hope to see. Maybe something like this:
There is a process already using the admin port 4848 – it is another instance of a GlassFish server.
Not successful in starting the domain : domain1
Other Glassfish Domain domain1 already using this port: 4848 - domain Location: C:\another\glassfish31\glassfish3\glassfish\domains\domain1
Command start-domain failed.
Maybe I'm being overly verbose, but you get the idea.
It just struck me as odd that glassfish didn't know that it was "this same glassfish" that was just started, and reported back to user that port 4848 was in use in previous command. The ouptut from the first start-domain command is clearly telling user which glassfish is started, including path information, i.e.
"Successfully started the domain : domain1
domain Location: C:\glassfish31\glassfish3\glassfish\domains\domain1
Log File: C:\glassfish31\glassfish3\glassfish\domains\domain1\logs\server.log
Admin Port: 4848"
Than along comes this second attempt to start-domain in the same shell, using the same path to the same glassfish, yet the glassfish couldn't somehow leverage some information from some place to report back to user that "this same glassfish" is already started. Makes glassfish look like it's not maximizing the known set of information available when producing error message back to user, it doesn't match what seems to be obvious when reporting "it probably is another instance of a GlassFish server."
My use case is this: I'm testing multiple binary installs of various Glassfish versions, both inside Netbeans and standalone. Sometimes I start Glassfish within Netbeans IDE and leave it running. I then do some other testing of another Glassfish install outside of Netbeans. When I try to start standalone Glassfish, it complains that port is already in use. Then I remember that I may have started Glassfish within Netbeans, so I stop domain running inside Netbeans. Then my standalone Glassfish domain can start. Other times Glassfish in Netbeans isn't the culprit, it's another standalone install of Glassfish started and left running, someplace, which I have to track down manually. I was hoping that Glassfish itself could be more helpful identifying the culprit process that is using default port, thus blocking another instance of Glassfish from starting. The analogy is "port in use" messages seen in server.log, which now identify which port is already in use, so user can change conflicting ports, 3700, 7676 etc. If Glassfish's asadmin start-domain domain1 command can be more helpful in helping users identify which process is using port, and if it's Glassfish process using that port, help user find path to that process, then user can more quickly stop the blocking process, or change conflicting ports, or take whatever appropriate corrective action necessary.
Ideally, from the use case scenario/perspective I've described, I think I'd like to know what path to "other Glassfish" is running so I could stop it, if it's Glassfish, that is using port that blocks new Glassfish from starting.