Using Netbeans together with GlassFish works like a charm. Especially when using the preconfigured GlassFish. There is one point which isn’t mentioned often: You can also work with an remote GlassFish.
When planning to use this feature you’ll have to switch to the “Services” window in Netbeans. Within this you should choose a new GlassFish-Instance to be added to the servers.
Within the next page of the following dialogs you’ve got to choose a locally installed instance:
This is needed so Netbeans can use the libraries provided by GlassFish. It shoud be the same version of GlassFish as the one on the webserver to avoid any problems.
The next step is the one where the remote instance is choosen. By default the local instance is choosen, but we’ll choose the other now:
After entering the informations everything should be fine, but there is still one step. Due to security restrictions the remote administration of the GlassFish isn’t enabled. So when you klick on Ok you will receive the following dialog:
[webserver]# asadmin enable-secure-admin
Enter admin user name> Â [your admin-user, default: "admin"]
Enter admin password for user “admin”> Â [the password of this user]
Command enable-secure-admin executed successfully.
After you’ve got enabled-secure-admin you will be asked to confirm a new certificate (on the console, which you should do). This command enables secure access to the admin functions. Which means that the admin-gui (on port 4848) is now running via https and is no longer avaliable using http. The communication between asadmin and GlassFish is now secured.
After stopping and starting GlassFish again, everything works fine. And you can work with the remote GlassFish.