I get the following error when I\'m trying to start my glassfish server with default settings from netbeans IDE 7.3.1:
java.net.BindException: Address already in
It seems that another server is using one of the ports assigned to your glassfish server.
In my case I got the exception SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-bio-8009"] java.net.BindException: Address already in use: JVM_Bind <null>:8009
It turn out to be a forgotten Tomcat instance already running on my pc. When i disabled the forgotten one the exception went away.
So in your case some other server is occupying a port used by your glassfish server. Find which server it is and stop it, or assign a different port to your glassfish server.
If you are on windows you can use the netstat -a -o
command and see witch process uses the port number:
For more on how to find a process running on a specific port see also this guide
The main reason is that another server is using the port 8080, that is the one per default (to check in windows if those ports are being used in the commands line: netstat -a -o)
You would need to change it in:
/glassfish/domains/domain1/config/domain.xml
Change:
name="http-listener-1" **port="8080"**
name="http-listener-2" **port="8181"**
To:
name="http-listener-1" **port="9090"**
name="http-listener-2" **port="9191"**
Then, remove the server from your framework (Eclipse for example), close it, start it and add the Glashfish again.
Before starting your framework make sure there is no file such:
/glassfish/domains/domain1/osgi-cache/felix/*.lock
In case it exists, remove it, you may stop any Java process for removing it.
These steps worked for me.
Have a look at /glassfish/domains/domain1/config/domain.xml, you should find a section like this
<network-listeners>
<network-listener name="http-listener-1" port="8080" protocol="http-listener-1" thread-pool="http-thread-pool" transport="tcp"/>
<network-listener name="http-listener-2" port="8181" protocol="http-listener-2" thread-pool="http-thread-pool" transport="tcp"/>
<network-listener name="admin-listener" port="4848" protocol="admin-listener" thread-pool="admin-thread-pool" transport="tcp"/>
</network-listeners>
These should be the ports glassfish needs to open. In my case I hade your same error due to the port 8181 being already used by another process. I changed the port to 8187 and everything worked fine. Otherwise you should find (netstat -a -b if you are on windows) and stop the processes using these ports before starting glassfish.