5
asadmin start-domain domain1

But it shows this error.

 There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.

I have searched and found that it could be the hostname or that the port is used by an other application or server and actually it is used by TCP.

I have no problem with the hostname so I've tried this solution by changing port.

  asadmin set server.http-service.http-listener.http-listener-1.port=10080

but it shows this error

remote failure: No configuration found for server.http-service.http-listener.http-listener-1
Command set failed.

I can't understand why.

sirineBEJI
  • 1,170
  • 2
  • 14
  • 25
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Jun 20 '17 at 13:41

4 Answers4

6

Assuming you are running glassifhs under linux

1 - Check if glassfish is already runnig.

ps -ef |grep java

kill any process java relative to glassfish

2 - Check if the port 4848 is in use

netstat -nao |grep 4848

3 - Change the default port

Edit the file {glassfish_home}/config/asadminenv.conf

AS_ADMIN_PORT=4848
Joao Vitorino
  • 2,976
  • 3
  • 26
  • 55
  • 2
    I cant locate the file. This is what I find : bex@bexlab:~/glassfish4/glassfish/config$ ls `asenv.bat` `asenv.conf` `branding` `client-jnlp-config.properties` `glassfish.container` `osgi.properties` – bademba Oct 16 '17 at 14:43
  • I encountered the same issue on CI server after upgrading to @actions/setup-java@v2, https://github.com/hantsy/jakartaee9-starter-boilerplate/runs/2293218091 – Hantsy Apr 08 '21 at 03:48
3

I just kill all glassfish processes

 pkill -f glassfish
EduOK
  • 121
  • 1
  • 6
3

I hit the same error.

This was useful - i.e. check you can ping $(hostname). Looks like glassfish checks hostname against IP, possibly during bind process.

My issue was my hostname/ip address in /etc/hosts was not aligned correctly, meaning I could not ping $(hostname). Once aligned and pinged, glassfish started ok.

Dazed
  • 1,069
  • 9
  • 34
  • Just wanted to add on a Mac here I did not have a problem while trying to ping the hostname. However, it was necessary for me to add the hostname in the /etc/hosts file to resolve this issue. – IchBin Dec 05 '22 at 21:44
  • And again for probably the 10th time I am here because I always forget about /etc/hosts – dmitry Aug 17 '23 at 13:11
0

I just hit this issue today. Be sure to delete the $PATH/TO/domain1/config/pid and $PATH/TO/domain1/config/pid.prev files as well, if the process isn't running but is being reported as still running.

mcpierce
  • 312
  • 5
  • 16