Leo Donahue - PLANDEVX wrote:
-----Original Message-----
From: André Warnier [mailto:a...@ice-sa.com]
Subject: Re: Tomcat 6.0.29 - Windows Service - JMX
Sorry if I ask, but how are you starting Tomcat in the second case ? as
a Service ?


Yes.  Starting Tomcat in the second case as a windows service.  Created the 
windows service using the service.bat - service install Tomcat6

I'll add a 3rd case : if you navigate to (catalina_home)\bin and double-click "tomcat6.exe", then in jvisualvm appears a local "unknown application" for that Tomcat.


The differences I can think of :

- using "net start tomcat.." starts the "tomcat6.exe" executable/wrapper (as a Service), which in turn runs a JVM, but using Windows Registry settings, not environment variables. In that case, the process (as seen by the Task Manager) appears to run "tomcat6.exe", not "java.exe"
In this case, the application does not appear in jvisualvm.

- launching tomcat6.exe directly, although it is the same wrapper, does not start tomcat as a Service, but starts it in a console window.
But I presume that it uses the same Registry settings as above.
In that case, the process (as seen by the Task Manager) also appears to run "tomcat6.exe", not "java.exe".
In this case, the application appears in jvisualvm, as an "unknown application (pid 
xxxx)"

- using startup.bat : (itself calling catalina.bat), tomcat is not started as a service, it runs in a console window. Also, it uses a bunch of environment variables and command-line parameters, set by startup.bat and catalina.bat and setenv.bat etc..
Also, in that case the executable which runs is "java.exe".
In this case, the application appears in jvisualvm, as a "tomcat (pid xxxx)"


I believe tbat the difference is due to the /user/ used to run tomcat.

In the case of the Service, the standard setup makes it run as "LocalSystem".
And in that case, the application does not appear in jvisualvm.

When tomcat is started in a command window however (the 2 other cases above), then it runs under the same user-id as the one you are logged-in as (*), and in that case jvisualvm "finds it".

(*) bad English, that is, but I don't know how to say this otherwise

To confirm this, I used the Windows Services applet to change the user under which tomcat runs, to be the same as my Windows login-id, then restarted the Service.
And tadaaaa, jvisualvm then finds it (but as the "unknown application").

So the fact of running either on the base of Registry settings or on the base of environment variables seems to have a bearing on jvisualvm's ability to find a name for the application. And the fact of running as either LocalSystem, or as the same user running jvisualvm, seems to determine if jvisualvm finds the application or not.

But do not ask me why this is so.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to