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.
2
  • 2
    user1277204 answer should be marked as correct, and given bounty, unresolvable hostname is what would produce misleading "Port in use" error. Mar 20, 2014 at 17:46
  • @PawelVeselov Yes, you're right. Marked his answer as the correct one. Too bad the bounty cannot be reassigned.
    – Kimi
    Mar 24, 2014 at 7:11

4 Answers 4

9

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.

1
  • 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!
    – java25
    Jan 12, 2015 at 10:49
3
+50

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.

1
  • 1
    I have no idea what just happened. But rebooting the whole server actually worked. Thank you!
    – Kimi
    Oct 8, 2013 at 9:55
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

-1

You can run

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

Fedora Project

1
  • There is nothing listening on those ports.
    – Kimi
    Oct 8, 2013 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.