Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asadmin create-domain fails: all ports are in use

I'm trying to create a new domain with the asadmin tool, but it fails every time reporting that all ports are in use. The OS is Fedora 19. What could be the problem?

$ ./bin/asadmin create-domain testdomain
Enter admin user name [Enter to accept default "admin" / no password]> 
Default port 4848 for Admin is in use. Using 52447
Default port 8080 for HTTP Instance is in use. Using 33934
Default port 7676 for JMS is in use. Using 33967
Default port 3700 for IIOP is in use. Using 34733
Default port 8181 for HTTP_SSL is in use. Using 52020
Default port 3820 for IIOP_SSL is in use. Using 46636
Default port 3920 for IIOP_MUTUALAUTH is in use. Using 39574
Default port 8686 for JMX_ADMIN is in use. Using 51770
Default port 6666 for OSGI_SHELL is in use. Using 41403
Default port 9009 for JAVA_DEBUGGER is in use. Using 60521
Port 52,447 is in use
CLI130 Could not create domain, testdomain
Command create-domain failed.
like image 525
Kimi Avatar asked Sep 26 '13 10:09

Kimi


2 Answers

I had the same issue and it finally turned out that my hostname was not configured inside of the /etc/hosts file. The error given by asadmin is somehow misleading. :-(

You could check if your hostname was correctly configured by:

ping `hostname`

If you get a "ping: unknown host" error you have to fix your hostname.

Login as root and fix your hostname using:

hostname "<YOUR_HOSTNAME>"

and to make it permanent by

echo "<YOUR_HOSTNAME>" > /etc/hostname

You also have to check that your /etc/hosts file contains a line like:

127.0.0.1        <YOUR_HOSTNAME>

after doing this you should not get the unknown host error when using ping.

I got the idea for the solutions from replies to this question.

like image 167
kaufholdr Avatar answered Sep 30 '22 16:09

kaufholdr


I had this once too. After restarting the whole server, it was possible to set the ports again. I don't know which but i am quite sure that some service is blocking it or that the glassfish process stucked.

like image 45
Nico Müller Avatar answered Sep 30 '22 16:09

Nico Müller