How to Debug your Java Application in a Payara Server #IntelliJ IDEA

I recently started working on some JAVA back end issues.

Never coded java since 2012. So…. FUN STUFF AHEAD :)

Even building the project was somewhat a challenge for me. let’s say I have build and ran the project somehow. Now it’s time to do some changes to the code. Now Debugging hits me hard.

Here is workflow I did to make the java application debug which is deployed in a Payara server.

Things I have now:

  1. Payara is already installed
  2. JAVA application is building without errors
  3. I have intellij

Following steps helped me to debug the application.

Stop the Payara server IF you have started it manually.

./asadmin stop-domain

Go to setting and add the Payara Platform Tools plugin

File --> Settings

Open the configuration for the debug options

Run --> Edit configurations

Add new configuration

Click the + sign in the left top corner 

Select Payara Server → Local to start with

Right hand side of the configuration window will look like this.

You can change the Name property at the top

Select the application server. This should automatically selects the Payara server if it is installed. If you can see the server you should select the Payara home location manually.

Click Configure beside the application servers.

select the location where you have installed Payara. In my case it’s

/home/asitha/payara5

Add the build to the deployment

Click on the deployment tab and click the + sign.

Select external source. Here you should select the .ear file of your application. In my case.

Also remove anything in the before launch section unless you have things to do

you can use the - sign to remove

Hit OK once completed.

Note: Add username and password if you have them for payara. In my case all those stays as default.

Build the application and click on the bug icon in the Debug configurations

Now, in the output you should see the process.

Now you can your debug points and check what going on.

Cheers !!!!

Senior Software Engineer ❤️ Node | Ruby