Over a million developers have joined DZone.

NetBeans IDE and Glassfish: Remote Deployments

DZone's Guide to

NetBeans IDE and Glassfish: Remote Deployments

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

Using NetBeans IDE together with GlassFish works like a charm. Especially when using the preconfigured GlassFish. There is one point which isn't mentioned a lot... you can also work with a remote GlassFish.

When planning to use this feature, you'll have to switch to the "Services" window in NetBeans IDE. Within this, you should choose a new GlassFish instance to be added to the servers:

Within the next page, you've got to choose a locally installed instance:

This is needed so that NetBeans IDE can use the libraries provided by GlassFish. It shoud be the same version of GlassFish as the one on the web server, to avoid any problems.

The next step is the one where the remote instance is chosen. By default, the local instance is chosen, but we'll choose the other now:

Now just hit "Finish!. Nearly everything is done to use the remote GlassFish now. After finishing the dialog, you get another dialog which requests the credentials for GlassFish:

After entering the information, 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 click on OK you 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. According to the documentation, Grizzly needs a reload to apply these settings.

After you've 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. That 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 now you can work with the remote GlassFish.

From: http://blog.e-beyond.de/2011/06/22/netbeans-and-glassfish-remote-deployments/

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}