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:
- Payara is already installed
- JAVA application is building without errors
- I have intellij
Following steps helped me to debug the application.
Step 01
Stop the Payara server IF you have started it manually.
./asadmin stop-domain
Step 02
Go to setting and add the Payara Platform Tools plugin
File --> Settings
Step 03
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
Step 04
Right hand side of the configuration window will look like this.
You can change the Name property at the top
Step 05
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
Step 06
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.
Step 07
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 !!!!