glassfish icon indicating copy to clipboard operation
glassfish copied to clipboard

asadmin start-domain overriding instanceport

Open mkarg opened this issue 6 years ago • 8 comments

In case the http listener's port (by default 8080) is blocked by another process, GlassFish obviously fails to start, so we need to change the port. As asadmin set won't work offline, this is not an option. Also, we do not want to hack domain.xml manually as that is error-prone.

Unfortunately there is no --instanceport option with start-domain.

Is there a (hidden or experimental) way to use set offline, or can the http listener port be provided with start-domain in some way?

mkarg avatar Jun 26 '19 13:06 mkarg

I'm not aware of a way to do that, but this is a good enhancement request.

The create-domain command tries to mitigate this problem by checking that the port is free when the domain is created, but obviously that doesn't help with the default domain that's included in the download.

bshannon avatar Jun 26 '19 20:06 bshannon

@bshannon Yes, exactly the included default domain is causing the troubles in our particular case. We fix that by modifying domain.xml by hand, which is just not nice. While start-domain --instanceport would override the cause of this particular problem, in fact an offline variant of set would be of more general purpose.

mkarg avatar Jun 27 '19 06:06 mkarg

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

github-actions[bot] avatar Jun 27 '20 00:06 github-actions[bot]

@arjantijms @smillidge Please reopen this issue, as it is neither solved nor irrelevant. Thanks.

mkarg avatar Mar 11 '21 08:03 mkarg

This issue has been marked as inactive and old and will be closed in 7 days if there is no further activity. If you want the issue to remain open please add a comment

github-actions[bot] avatar Mar 12 '22 01:03 github-actions[bot]

Let's keep it open. Hopefully someday, someone, will look at this.

arjantijms avatar Mar 13 '22 17:03 arjantijms

Anybody willing to fix this eventually? 🤔

mkarg avatar May 27 '25 16:05 mkarg

What are suggested solutions?

I can think of these options:

  1. support running asadmin set without a server running - probably doable by starting the server from the set command and then stopping it before it gets to binding ports or anything that could end with an error
  2. add an option to override port numbers by an argument to start-domain command
  3. add an option to run set commands or even other asadmin commands at server startup, allowing to modify configuration before the server initializes listeners

I think the easiest and probably simplest is the solution 3. It would also be universal and would allow more changes to the configurstion. We could also add support for a stop after boot, which would then work as solution number 1.

OndroMih avatar May 28 '25 06:05 OndroMih