Buy Support Online

Payara for Beginners - Adding Payara Server to NetBeans

28 Feb 2017

When testing an app to be run on Payara Server, it can be extremely useful to be able to test your app continuously in your IDE (after all, that’s what it’s there for). If you're using NetBeans this is made very easy. Follow the steps in this blog to setup the Payara Server in NetBeans for running your web apps.

 

If you haven't made a project to test yet, carry on to the first section of this guide. If you already have an app to run, then you can skip this section.

 

Creating a Test Application with Maven

  1. First, create a project using the new project wizard. Go to the Maven category, and select 'Project from Archetype'. Click next.
  2. Select the archetype named 'maven-archetype-webapp'. Click next.

 NetBeans Plugin Blog 3.png

 

3. Select a project name and group ID. The bottom 4 settings are for maven. For naming conventions use the following page: https://maven.apache.org/guides/mini/guide-naming-conventions.html

 

NetBeans Plugin Blog 4.png

 

4. You've successfully made your first web app for deploying to Payara Server!

 

Adding Payara Server to NetBeans

Payara Server now has a set of NetBeans plugins for better integration. This allows you to add Payara Server as a recognised server in NetBeans and then deploy and manage applications from the Netbeans interface. Adding the Payara NetBeans plugins can be done with the following steps:

  1. Go to Tools → Plugins.
  2. In the 'Available Plugins' tab search for 'Payara', then check all of the available checkboxes. This will include the main plugin as well as common libraries for accessing Payara Server.

NetBeans Plugin Blog 1.png

 

 

 

3. After the plugin installation, click the Finish button to restart the NetBeans IDE.

 

 

NetBeans Plugin Blog 2.png

 

Now that you've got your project set up, you need to setup the Payara Server itself. The setup is done using the following steps:

  1. Go to Tools → Servers and click Add Server.
  2. Select Payara Server, and name the server whatever you want. For this example I've named it 'Payara'. Click next.

NetBeans Plugin Blog 5.png

 

3. Select the location of the 'payara41' directory from the extracted Payara Server. Read and accept the license agreement. Click next.


4. Select a domain. A domain is essentially a server at runtime. Unless you've created your own, you can use domain1 as it's the default domain. Enter 'admin' as the username and leave the password field blank.

 

NetBeans Plugin Blog 6.png

 

5. The server is now created! Make sure the details are all correct on this screen. I've also disabled the option 'Start Registered Derby Server' as the test app we've made doesn't use it, so it will speed up server startup time slightly. If you need the database, then leave this box checked.

 

NetBeans Plugin Blog 7.png

 

6. After exiting this window, right click your test project and select 'Run', followed by selecting the server you just created. The server will start up and you should eventually be greeting with a 'Hello World!' message in your browser.
To stop the server, switch to the server log at the bottom of the window under Output → 'Name of created server'. Click the stop sign in this window.

 

adding payara to netbeans 4.png

 

adding payara to netbeans 5.png

 

That's how to add Payara Server to NetBeans! You are now able to run any project on Payara Server in a similar fashion to this one.

 

 

Beginner's Guides to Payara Server

 

 

Comments

Subscribe

Themes

see all