Question

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.
Was it helpful?

Solution

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.

OTHER TIPS

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.

When you create a new domain you can specify the portbase parameter. In this way port conflicts are avoided.

$ ./bin/asadmin create-domain --portbase 10000 testDomain
Enter admin user name [Enter to accept default "admin" / no password]>
Using port 10048 for Admin.
Using port 10080 for HTTP Instance.
Using port 10076 for JMS.
Using port 10037 for IIOP.
Using port 10081 for HTTP_SSL.
Using port 10038 for IIOP_SSL.
Using port 10039 for IIOP_MUTUALAUTH.
Using port 10086 for JMX_ADMIN.
Using port 10066 for OSGI_SHELL.
Using port 10009 for JAVA_DEBUGGER.
[..]
Domain testDomain created.
Domain testDomain admin port is 10048.
Domain testDomain allows admin login as user "admin" with no password.
Command create-domain executed successfully.

see: http://docs.oracle.com/cd/E26576_01/doc.312/e24938/create-domain.htm

You can run

netstat -anp | grep 52
netstat -anp | grep 447 

Fedora Project

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top