Question

I successfully managed to install the JProfiler remote probe and I see it running in 'catalina.out' (Tomcat). The only problem is that all ports on the remote machine are firewalled (except for 80 and 8080) and no matter which port I chose, the JProfiler GUI can't connect to the remote probe.

I tried to use PuTTY tunneling but I'm not really sure how to set up the tunneling rules. Moreover, it seems that there are no 'network preferences' in JProfiler where I can specify SOCKS proxy.

How can I overcome this problem without bothering the firewall rules? The remote machine is not in my direct control and it takes a lot of time and paperwork to open additional ports.

Was it helpful?

Solution

I found a solution which involves several steps.

Step 1: Create proper SOCKS tunneling:

PuTTY proxy settings for JProfiler when profiling remote application with firewall.

Don't forget to click the 'Add' button in the end.

Step 2: Modify the JProfiler's startup script and add the SOCKS proxy settings:

java -Xmx512m -classpath "%LOCALCLASSPATH%" -DsocksProxyHost=localhost -DsocksProxyPort=8849 com.jprofiler.frontend.FrontendApplication

The above code snippet should be placed in jprofiler.bat which is located here:

\Program Files\jprofiler8\bin\windows

Step 3: Open remote JProfiler session and use the original remote host and the original remote port. In other words, start normal remote profiling session with no deviations from the original process. The PuTTY tunneling will take care of the firewall problem for you automatically.

OTHER TIPS

I do the same thing with SSH (using Cygwin on Windows):

ssh -L 8849:localhost:8849 <username>@<target-hostname>

Since it is not a privileged port, you can login as a standard user.

Then I can connect the JProfiler GUI to port 8849 on the local Windows machine.

BTW, I also use jpenable on the target to expose the profiling agent without modifying the application server start/config files:

jpenable --pid=<app-server-pid> --noinput --gui --port=8849
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top