How to Setup Netbeans Profiler for Payara server deployed in remote windows host?

54 views Asked by At

These are the instructions from Netbeans 16 when I try to setup a remote profiling for Manually Started remote Java Process.

Step 1: Make sure the target application is configured to run using Java 6+. Click to update steps for profiling JDK 5 applications. My web application is deployed on Payara Community edition 5 server based on JDK 11

Step 2: If you have not done it before create a Remote profiling pack for the selected OS & JVM and upload it to the remote system. Remote profiling pack root directory will be referred to as . I have created a remote profiling pack from netbeans and copied the files over to the remote host system

Step 3: If you have not run profiling on the remote system yet, run the \bin\calibrate.bat script first to calibrate the profiler. I ran this script although I did not have indication it ran correctly, a windows just popped and closed very fast. I am taking that as a sign that this script ran, please let me know if this is not correct

Step 4: Add the following parameter(s) to the application startup script (copy to clipboard):

-agentpath:\lib\deployed\jdk16\windows-amd64\profilerinterface.dll=\lib,5140

This is the part I am not sure about. I have copied this line and inserted it as a < jvm-option /> in the domain.xml file for my payara server domain, after which the server starts but I now cannot access any applications or the admin console. I also set this value in the asadmin.bat script but this also does not seem to do anything. Because When I connect the profiler I do not see any indication in the Netbeans telemetry window or the objects windows about any statistics about the JVM

Step 5: Start the target application. The process will wait for the profiler to connect. I assume this just means to start the payara server

Step 6: Submit this dialog and click the Attach button to connect to the target application and resume its execution. Nothing happens when I click on the attach button

I have looked up tutorials for setting up Netbeans profiler for remote host but could not find any strong thorough reference. If someone could explain how to set it up,what am I doing wrong or could point me to some potential resources I would really appreciate it.

1

There are 1 answers

0
Mausam Shrestha On

For Payara Community Edition 5 running on JDK 11, you can login to the admin console, and under the server-config select the JVM Settings. On the tabs, click on Profiler and add these inputs: Profiler -> nbprof

Status -> enabled

Class Path -> Path to your lib folder in remote calibration pack you uploaded in the remote system that you wanted to profile

Native Library Path -> Same as class path

Then Add a JVM option, -agentpath:\lib\deployed\jdk16\windows-amd64\profilerinterface.dll=\lib,5140 Where is the absolute path to the remote calibration pack on your remote system. You can either do this, or add the profiler option manually under domain.xml for your payara server instance. You need to restart the server, and then click on Attach the profiler in your netbeans to connect the profiler to the remote instance.