asadmin create-domain fails: all ports are in use
Asked Answered
G

4

7

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.
Grow answered 26/9, 2013 at 10:30 Comment(2)
user1277204 answer should be marked as correct, and given bounty, unresolvable hostname is what would produce misleading "Port in use" error.Featheredge
@PawelVeselov Yes, you're right. Marked his answer as the correct one. Too bad the bounty cannot be reassigned.Grow
A
8

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.

Arreola answered 26/10, 2013 at 7:35 Comment(1)
This is the correct solution! Had the same issue. Added a new hostname under 127.0.0.1 which originally only has "localhost" defined. Then problem solved!Subtenant
S
3

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.

Stunk answered 3/10, 2013 at 12:9 Comment(1)
I have no idea what just happened. But rebooting the whole server actually worked. Thank you!Grow
F
2

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

Fatuity answered 16/7, 2014 at 16:34 Comment(0)
S
-1

You can run

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

Fedora Project

Styx answered 8/10, 2013 at 8:58 Comment(1)
There is nothing listening on those ports.Grow

© 2022 - 2024 — McMap. All rights reserved.