You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Björkman <pe...@josh.se> on 2006/10/25 16:20:48 UTC

Uniquely identifying an servlet runner instance...

I need to store in our database (along with other information) which of our servers that made the save. Is it possibly to dynamically find a property that identifies it? Or will I have to have separate web.xmls with init parameters that I can use? The purpose is to be able to see (in the database) on what server/instance a user is logged on.

The server name is not really enough, we could run multiple Tomcats on the same machine.

Regards
Peter Björkman
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.f-secure.com/

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


RE: Uniquely identifying an servlet runner instance...

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Pid [mailto:p@pidster.com] 
> Subject: Re: Uniquely identifying an servlet runner instance...
> 
> you could also use a properties fil, containing a unique name for each
> app/server

There's also the name attributes of the <Service> and <Engine> tags;
either of these could be used to identify the container if set to unique
values.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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


Re: Uniquely identifying an servlet runner instance...

Posted by Pid <p...@pidster.com>.
you could also use a properties fil, containing a unique name for each
app/server

Peter Björkman wrote:
> I need to store in our database (along with other information) which of our servers that made the save. Is it possibly to dynamically find a property that identifies it? Or will I have to have separate web.xmls with init parameters that I can use? The purpose is to be able to see (in the database) on what server/instance a user is logged on.
> 
> The server name is not really enough, we could run multiple Tomcats on the same machine.
> 
> Regards
> Peter Björkman
> ###########################################
> 
> This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
> For more information, connect to http://www.f-secure.com/
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 


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


Re: Uniquely identifying an servlet runner instance...

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Peter,

> I need to store in our database (along with other information) which
> of our servers that made the save. Is it possibly to dynamically find
> a property that identifies it? Or will I have to have separate
> web.xmls with init parameters that I can use? The purpose is to be
> able to see (in the database) on what server/instance a user is
> logged on.
> 
> The server name is not really enough, we could run multiple Tomcats
> on the same machine.

If you have several instances of Tomcat, you ought to have different
server.xml files for each instance.

You could put a <GlobalNamingParameter> entry into server.xml that
identifies the server. You can get this value out using JNDI at runtime.

The Tomcat 4.1 sample server.xml files contain an example of an Integer
value in the GlobalNamingResources:

  <GlobalNamingResources>

    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

    .
    .
    .
  </GlobalNamingResources>

I would imagine that later versions of Tomcat (5.x) would have the same
capability, and that you could adopt this technique to suit your needs.

-chris