1

I want to profile an .exe-wrapped Windows Service that is written in Java EE and is deployed on JBoss 4.2.2 GA, which logs on as Local System. Wrapping was done by using the Tanuki Java service wrapper. My profiler of choice is jProfiler, which cannot detect the aforementioned service. So far, my question seems to be answered here, but to change the logon account of the service stops its proper functionality.

Is there a workaround on jProfiler or another profiler which could I use to profile this service?

Kapoios
  • 688
  • 7
  • 22

1 Answers1

1

You can add VM parameters to a Tanuki service wrapper in wrapper.conf like this:

wrapper.java.additional.n=...

To get the VM parameter for profiling, execute Session->Integration Wizards->New Remote Integration in the JProfiler GUI.

You can also use the "quick attach" functionality in JProfiler to profile a Windows service that is already running. JProfiler will list all services that are running on your local machine when you activate the "Show services" button in the top right corner of the attach dialog.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • I have already used the "quick attach" functionality, with the "show services" ioption enabled, but jProfiler failed to detect the service. I saw it is a common problem, although it is stated in an other SO question that the versions >=10.0.0 of jProfiler list all services that are on a JVM and log on as local system. – Kapoios Dec 07 '17 at 09:48
  • Actually they can log on as any user. You can run into problems if there is a problem with the temp directory, though. Please use the method of passing the VM parameter at startup in that case. – Ingo Kegel Dec 07 '17 at 10:33
  • Something that surprised me is that I had to provide the port of the foreign address of the application server's respective process on jProfiler in order to monitor it. – Kapoios Dec 11 '17 at 08:26
  • You mean the port for the connection to the profiling agent, with the default value of 8849? There can be multiple profiling agents on the remote machine, each listening on a different port. – Ingo Kegel Dec 11 '17 at 08:30
  • Indeed, I mean this port. I need to know how exactly the jProfiler locates the correct application (the service I mentioned in my answer in my case) to profile. – Kapoios Dec 11 '17 at 08:54
  • The ports that you specify as an option in the -agentpath VM parameter and the one in the session configuration in the JProfiler GUI must match. The default port is 8849, so you can omit that in the -agentpath parameter. – Ingo Kegel Dec 11 '17 at 11:13
  • Oops, now I see... Thanks once again. – Kapoios Dec 11 '17 at 11:22