This was going to be my suggestion as well: have it start after a user
logs in, via either the Run registry entry, or the startup group on the
start menu.
D
David Smith wrote:
Then I think you'll have to have tomcat startup in the Startup program
group or equivalent in the registry and shutdown when the user log's
out. That will put tomcat in the user's environment and make it run
as the current desktop user.
--David
Sureka, Sushil wrote:
Because we are using the app more like a standalone application (for
details please see my another posting). Generally these sort of app are
not meant for tomcat, but we already had the app developed for central
server, and we had a need to run the same app in a standalone mode for
folks who are not connected to internet. Hence we took the same code
base (with lot less fat) and ported it on tomcat.
-----Original Message-----
From: David Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, August
13, 2008 1:47 PM
To: Tomcat Users List
Subject: Re: Reading environment variable from Tomcat
Looks like correct behavior to me. You can see that tomcat runs in
the System account when you look at it via Process Explorer or Task
Manager. It has it's own environment separate from any desktop user and
can run without any desktop user. This is also why tomcat can't
access mapped network drives when it runs as a service.
The real question is why do you want to know who the current desktop
user(s) is/are? Tomcat should only be interested in the users coming in
via http(s) connections.
--David
Sureka, Sushil wrote:
Hi,
I have run into an issue related to starting tomcat as a service. When
we were starting tomcat from the command line, we were able to just
say
System.getProperty("user.name" ) to retrieve the logged in user id.
But
now that we start tomcat using a service, the get property call
returns
"SYSTEM".
After doing some more research, it seems like I have two options to
find
out the login id.
1. Start the service using logged on option.
2. Use System.getEnv()
It seems like the first option may not work for us as our passwords
expires periodically, and setting the logon/password account means
that
we would have to have manual intervention. Additionally, when I tried
use my user id as logon id, it won't let me do that ( I imagine I need
to have system admin turn the privilege on for or something on those
lines)
The second option did not work either. Calling the
System.getEnv("USERNAME") in a program started from the command line
returns the logged in user name, but it returns null when tomcat was
started using service approach.
I am not sure if there is a way to find out who is logged in into the
system when Tomcat has been started using service mechanism. Any help
in
this matter would be great help
SS
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]