users@glassfish.java.net

Re: cannot connect to glassfish or run any projects because server wont start

From: Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>
Date: Sun, 15 Mar 2009 13:36:39 +0100

GlassFish uses at least eight ports. 4848 is for the admin
http-listener, 8080 is for serving web requests, 8181 for serving https
requests, 3700 is used for the object broker and so on. If GlassFish is
not able to use any of these ports it cannot start and thus Netbeans
cannot use 4848 for deployment - since the server startup failed. Just
have a look at the log you attached. There are six attempts to start
GlassFish that failed due to port 8080 being in use.

An example output for a list of all used ports of a v2 server:
asadmin get "*.*.port"
server.admin-service.jmx-connector.system.port = 8686
server.http-service.http-listener.admin-listener.port = 4848
server.http-service.http-listener.http-listener-1.port = 8080
server.http-service.http-listener.http-listener-2.port = 8181
server.iiop-service.iiop-listener.SSL.port = 3820
server.iiop-service.iiop-listener.SSL_MUTUALAUTH.port = 3920
server.iiop-service.iiop-listener.orb-listener-1.port = 3700
server.jms-service.jms-host.default_JMS_host.port = 7676

You can change these settings as mentioned in my previous post in the
file domain.xml. 8080 is the default for web listening in Tomcat and
GlassFish, so you definitely have to change it. I think all the other
ports of both (Tomcat also uses more ports than just 8080 by default) do
not conflict with each other.

You can also change the settings of Tomcat (if you prefer changing
those) in Tomcat's server.xml file.

--
Wolfram Rittmeyer