views:

20

answers:

1

I am running GlassFish 3.0.1 as a windows service under Windows Server 2003 with Java 1.6 u 20, and am generally happy.

I would like to be able to use VisualVM on this JVM and used http://stackoverflow.com/questions/503057/unable-to-use-jconsole-with-tomcat-running-as-windows-service/812041#812041 as a starting point, but starting with

PsTools\PsExec.exe -i -s "C:\Program Files\Java\jdk1.6.0_20\bin\jvisualvm.exe"

results in a jvisualvm.exe and a nbexec.exe process showing up in Task Manager with SYSTEM as the user but I do not see any GUI from the program as I do when I run it manually as myself. I am logged in with Remote Desktop from Windows 7 in case that makes any difference.

Other interesting points:

at 10:55 /interactive cmd.exe

reports a new job has been added, but does not open a CMD window at 10.55.

The description of how to register VisualVM as a service reports the service to start but no GUI shows up. http://blogs.sun.com/nbprofiler/entry/monitoring_java_processes_running_as

Have anybody gotten this to run under Windows Server 2003?

A: 

The way I'm able to get this to work is to make sure that you remote desktop to the server's "console" session.

Simply put, when you open mstsc.exe append the text " /admin" to the computer name you are trying to connect to. For instance, if you were trying to connect to a server called "FOO", then in the Computer name text box in mstsc.exe, you would enter "FOO /admin".

After connecting and logging in to the server, you can execute your PsExec command. You should then see Visual VM with the GlassFish process you are trying to connect to.

For more info about connecting to the console session with remote desktop in Windows, have a look at the "How to Connect to the Console" section http://support.microsoft.com/kb/278845.

Also, for those looking for PsExec.exe, you can get it from the PsTools package from Microsoft at technet.microsoft.com/en-us/sysinternals/bb897553.aspx.

groggluebutt
Can you make this work when you are running on a Windows 7 Pro machine, and the service is running on the same host?
Thorbjørn Ravn Andersen