Reading environment variable from Tomcat

2008-08-13 Thread Sureka, Sushil
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



RE: Reading environment variable from Tomcat

2008-08-13 Thread Sureka, Sushil
The service does not need to run when no one is logged in. We are in a
kind of one off situation where Tomcat would be running on standalone
laptops when the users are not connected to internet. So we are not
running it on windows server rather on windows xp.

I saw the other reply but I am not sure if I understand how to make that
work. I just tried the option of adding --User in the service.bat
specifying my user id, but it did not work. Also as I mentioned in my
original email, the password issue will remain as a problem even if we
get past the first issue.

SS

-Original Message-
From: David kerber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2008 1:27 PM
To: Tomcat Users List
Subject: Re: Reading environment variable from Tomcat

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
   
Somewhat related to this: what do you want it to return when nobody is 
logged on?  When it's a service and set to automatic start, the system 
will run without needing to be logged on (just sitting at the logon 
prompt)...

D



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Reading environment variable from Tomcat

2008-08-13 Thread Sureka, Sushil
I responded to this in another email. Youssef, I would appreciate if you
can provide your input (I am just trying to consolidate my answer in one
email for better readability)

-Original Message-
From: Youssef Mohammed [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2008 1:33 PM
To: Tomcat Users List
Subject: Re: Reading environment variable from Tomcat

+1
exactly!  you can even login with two different users (if you are using
windows server) none of them would be running the service unless you
change
the logged on option.

On Wed, Aug 13, 2008 at 9:27 PM, David kerber [EMAIL PROTECTED]
wrote:

 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


 Somewhat related to this: what do you want it to return when nobody is
 logged on?  When it's a service and set to automatic start, the system
will
 run without needing to be logged on (just sitting at the logon
prompt)...

 D



 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Regards, Youssef

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Reading environment variable from Tomcat

2008-08-13 Thread Sureka, Sushil
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]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Defining JDBC Data source

2008-03-05 Thread Sureka, Sushil
We are trying to port an application from Weblogic to Tomcat. Our JDBC
entry looks like this

bean id=the_dataSource
class=org.springframework.jndi.JndiObjectFactoryBean
property name=jndiName value=myJDBC /
/bean

The weblogic works fine with setup. The jdbc datasource is setup through
weblogic console.

On Tomcat, we noticed that we would have to modify the above entry like
this

bean id=the_dataSource
class=org.springframework.jndi.JndiObjectFactoryBean
property name=jndiName value=java:/comp/env/myJDBC
/
/bean 

But the above setup won't work for Weblogic. Any way we can reconcile
the difference. The Tomcat context.xml file contains an entry llike

Context

Resource name=myJDBC auth=container ./

/context

Sushil



Tomcat installation/deployment question

2008-01-24 Thread Sureka, Sushil



Hi,
 
We are intending to deploy our application on individual laptops
(to be used by field personnel who does not have internet connectivity
to connect to our central server). The idea is that a trimmed down
version of our core application will be deployed on individual laptops
running tomcat against a light weight Sybase database.
 
I wanted to see if you had any suggestions about - 
1. How best to deploy the initial version (5.5) of Tomcat on
individual machines  - We understand our options are Microsoft SMS, Java
Web Start application, shell script or Ant script to install Tomcat on
these laptop boxes. We are leaning towards Microsoft SMS since 
(a) It can easily mass deploy the app to hundreds of machine
(b) It is currently used in our organization to deploy some asp
application. 
If you believe there are downsides to this approach or other
approaches are better please let me know
 
2. How best to deploy the upgraded version (6.x or higher) - We
potentially could use the same approach as the first one, but wanted to
see if the opinion differs.
 
3. And finally the rollout of initial app and upgraded app
version. Again probably use the same approach as before but wanted to
throw this out there in case there are better ideas.
 
Please let me know your thoughts on this.
 
Sushil



RE: Tomcat installation/deployment question

2008-01-24 Thread Sureka, Sushil
XP but there is no guarantee that they won't go to Vista in a year
timeframe.

Sushil 

 -Original Message-
 From: Gabe Wong [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 24, 2008 11:54 AM
 To: Tomcat Users List
 Subject: Re: Tomcat installation/deployment question
 
 Sureka, Sushil wrote:
 
  Hi,
   
  We are intending to deploy our application on 
 individual laptops (to 
  be used by field personnel who does not have internet 
 connectivity to 
  connect to our central server). The idea is that a trimmed down 
  version of our core application will be deployed on 
 individual laptops 
  running tomcat against a light weight Sybase database.
   
  I wanted to see if you had any suggestions about - 
  1. How best to deploy the initial version (5.5) of Tomcat on 
  individual machines  - We understand our options are Microsoft SMS, 
  Java Web Start application, shell script or Ant script to install 
  Tomcat on these laptop boxes. We are leaning towards 
 Microsoft SMS since
  (a) It can easily mass deploy the app to hundreds of machine
  (b) It is currently used in our organization to deploy some asp 
  application.
  If you believe there are downsides to this approach or other 
  approaches are better please let me know
   
  2. How best to deploy the upgraded version (6.x or higher) - We 
  potentially could use the same approach as the first one, 
 but wanted 
  to see if the opinion differs.
   
  3. And finally the rollout of initial app and upgraded 
 app version. 
  Again probably use the same approach as before but wanted to throw 
  this out there in case there are better ideas.
   
  Please let me know your thoughts on this.
   
  Sushil
 
 

 Sushil,
 
 The Laptops I presume will be running Windows? If so which version(s)?
 
 
 --
 Regards
 
 Gabe Wong
 NGASI AppServer Manager
 JAVA AUTOMATION and SaaS Enablement
 a href=http://www.ngasi.comhttp://www.ngasi.com/a
 NEW! 8.0 - Centrally manage multiple physical servers
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org To 
 unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat installation/deployment question

2008-01-24 Thread Sureka, Sushil
Well we are not intending to use laptops to server multiple user. The
idea is that the user who is logged in on the laptop would just work
locally, when disconnected from network, and then we would synch  up the
database running on laptop with the central database.  

 -Original Message-
 From: Martin Gainty [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 24, 2008 1:31 PM
 To: Tomcat Users List
 Subject: Re: Tomcat installation/deployment question
 
 possibly better off with a server offering as specified in 
 documentation http://people.apache.org/~mturk/docs/article/ftwai.html
 For non server products like Windows 2000 Professional or 
 Windows XP the number of concurrent connections is limited to 
 10. This mean that you can not use workstation products for 
 production servers unless the 10 connections limit will 
 fulfil your needs. 
 
 M-
 - Original Message -
 From: Sureka, Sushil [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, January 24, 2008 1:00 PM
 Subject: RE: Tomcat installation/deployment question
 
 
 XP but there is no guarantee that they won't go to Vista in a 
 year timeframe.
 
 Sushil
 
  -Original Message-
  From: Gabe Wong [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 24, 2008 11:54 AM
  To: Tomcat Users List
  Subject: Re: Tomcat installation/deployment question
 
  Sureka, Sushil wrote:
  
   Hi,
  
   We are intending to deploy our application on
  individual laptops (to
   be used by field personnel who does not have internet
  connectivity to
   connect to our central server). The idea is that a trimmed down 
   version of our core application will be deployed on
  individual laptops
   running tomcat against a light weight Sybase database.
  
   I wanted to see if you had any suggestions about - 1. How best to 
   deploy the initial version (5.5) of Tomcat on individual 
 machines  - 
   We understand our options are Microsoft SMS, Java Web Start 
   application, shell script or Ant script to install Tomcat 
 on these 
   laptop boxes. We are leaning towards
  Microsoft SMS since
   (a) It can easily mass deploy the app to hundreds of machine
   (b) It is currently used in our organization to deploy some asp 
   application.
   If you believe there are downsides to this approach or other 
   approaches are better please let me know
  
   2. How best to deploy the upgraded version (6.x or higher) - We 
   potentially could use the same approach as the first one,
  but wanted
   to see if the opinion differs.
  
   3. And finally the rollout of initial app and upgraded
  app version.
   Again probably use the same approach as before but wanted 
 to throw 
   this out there in case there are better ideas.
  
   Please let me know your thoughts on this.
  
   Sushil
  
  
  
  Sushil,
 
  The Laptops I presume will be running Windows? If so which 
 version(s)?
 
 
  --
  Regards
 
  Gabe Wong
  NGASI AppServer Manager
  JAVA AUTOMATION and SaaS Enablement
  a href=http://www.ngasi.comhttp://www.ngasi.com/a
  NEW! 8.0 - Centrally manage multiple physical servers
 
 
  
 -
  To start a new topic, e-mail: users@tomcat.apache.org To 
 unsubscribe, 
  e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org To 
 unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org To 
 unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat installation/deployment question

2008-01-24 Thread Sureka, Sushil
Martin, thanks for the advise. We are already decided to move forward
with the decision to deploy on individual laptops. So yes we will have
sufficient hardware on laptop.

The question, what is the best way to put the tomcat installation and
upgrades, application installation and upgrades on the server. In other
words, question is not if, but how

Sushil

 -Original Message-
 From: Martin Gainty [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, January 24, 2008 2:21 PM
 To: Tomcat Users List
 Subject: Re: Tomcat installation/deployment question
 
 you can install a server product (2003) on a laptop which has 
 the requisite chip characteristics/sufficient ram 
 (4gb)/sufficient diskspace(.25 tera) and sufficient 
 clockspeed (in other words server hardware characteristics) 
 to support that server
 
 Databases:
 You can configure your connection-string to point to the 
 remote DB server and remote DBname which has a DBlistener 
 installed e.g.
 
 private static Driver c_Driver = null;
 private static final String c_sDefaultDriverName = 
 oracle.jdbc.driver.OracleDriver,
 private static final String  c_sDefaultDBURL = 
 jdbc:oracle:thin:@host:Port:DBName,
 
 try {
 c_Driver = (Driver)Class.forName( 
 c_sDriverName ).newInstance();
 }
 catch ( ClassNotFoundException cex )
 {
 }
 
 //set your properties here and then connect with the provided 
 URL connection-string
c_Driver.connect( c_sDBURL, props );
 
 
 - Original Message -
 From: Sureka, Sushil [EMAIL PROTECTED]
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thursday, January 24, 2008 2:39 PM
 Subject: RE: Tomcat installation/deployment question
 
 
 Well we are not intending to use laptops to server multiple 
 user. The idea is that the user who is logged in on the 
 laptop would just work locally, when disconnected from 
 network, and then we would synch  up the database running on 
 laptop with the central database.
 
  -Original Message-
  From: Martin Gainty [mailto:[EMAIL PROTECTED]
  Sent: Thursday, January 24, 2008 1:31 PM
  To: Tomcat Users List
  Subject: Re: Tomcat installation/deployment question
 
  possibly better off with a server offering as specified in 
  documentation 
 http://people.apache.org/~mturk/docs/article/ftwai.html
  For non server products like Windows 2000 Professional or 
 Windows XP 
  the number of concurrent connections is limited to 10. This 
 mean that 
  you can not use workstation products for production servers 
 unless the 
  10 connections limit will fulfil your needs. 
 
  M-
  - Original Message -
  From: Sureka, Sushil [EMAIL PROTECTED]
  To: Tomcat Users List users@tomcat.apache.org
  Sent: Thursday, January 24, 2008 1:00 PM
  Subject: RE: Tomcat installation/deployment question
 
 
  XP but there is no guarantee that they won't go to Vista in a year 
  timeframe.
 
  Sushil
 
   -Original Message-
   From: Gabe Wong [mailto:[EMAIL PROTECTED]
   Sent: Thursday, January 24, 2008 11:54 AM
   To: Tomcat Users List
   Subject: Re: Tomcat installation/deployment question
  
   Sureka, Sushil wrote:
   
Hi,
   
We are intending to deploy our application on
   individual laptops (to
be used by field personnel who does not have internet
   connectivity to
connect to our central server). The idea is that a trimmed down 
version of our core application will be deployed on
   individual laptops
running tomcat against a light weight Sybase database.
   
I wanted to see if you had any suggestions about - 1. 
 How best to 
deploy the initial version (5.5) of Tomcat on individual
  machines  -
We understand our options are Microsoft SMS, Java Web Start 
application, shell script or Ant script to install Tomcat
  on these
laptop boxes. We are leaning towards
   Microsoft SMS since
(a) It can easily mass deploy the app to hundreds of machine
(b) It is currently used in our organization to deploy some asp 
application.
If you believe there are downsides to this approach or other 
approaches are better please let me know
   
2. How best to deploy the upgraded version (6.x or higher) - We 
potentially could use the same approach as the first one,
   but wanted
to see if the opinion differs.
   
3. And finally the rollout of initial app and upgraded
   app version.
Again probably use the same approach as before but wanted
  to throw
this out there in case there are better ideas.
   
Please let me know your thoughts on this.
   
Sushil
   
   
   
   Sushil,
  
   The Laptops I presume will be running Windows? If so which
  version(s)?
  
  
   --
   Regards
  
   Gabe Wong
   NGASI AppServer Manager
   JAVA AUTOMATION and SaaS Enablement
   a href=http://www.ngasi.comhttp://www.ngasi.com/a
   NEW! 8.0 - Centrally manage multiple physical servers