If you are having errors when adding a remote GlassFish server to your NetBeans installation and you are sure there's connectivity between you and the remote server and all the required ports are open, a possible cause might be not having the remote secure administration enabled (which is required if you want to deploy remotely).
|__locations failed on Glassfish VM|
|Remote host closed connection during handshake|
Just get access to your server's system console and use
asadminto enable the secure administration:
Make sure you have the GlassFish
binfolder in your path, which contains the