Netbeans and Glassfish remote deployments

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:

Now just hit finished. Nearly everything is done to use the remote GlassFish. After finishing the dialog you got another dialog which requests the credentials for the GlassFish:

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:

This dialog gives you a hint on what to do next: You have to execute “asadmin enable-secure-admin” on the remote server:

[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.

Now you can try again, but you will still receive the same error. Due to the documentation Grizzly needs a reload to apply these setting.

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.

This entry was posted in Glassfish, Java, JavaEE, Netbeans. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s