You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brian Barnett <br...@calcxml.com> on 2007/08/24 03:39:11 UTC

Need a way to identify tomcat instances at run-time

I have a struts-based application running on multiple tomcat instances, load balanced by a hardware load balancer, i.e., no Apache Web Server. I need a way at run-time to know which tomcat instance it is. Is there a way to access info in the server.xml or context.xml file at run-time? Can I specify some arbitrary value in either of those xml files that would be available at run-time? Is there some other way to identify the tomcat instance at run-time? Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?

Any ideas would be appreciated.

Thanks,
Brian Barnett



---------------------------------------------------------------------
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: Need a way to identify tomcat instances at run-time

Posted by Brian Barnett <br...@calcxml.com>.
Chris,
I don't know what you mean by your response.

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Friday, August 24, 2007 6:43 AM
To: Tomcat Users List
Subject: Re: Need a way to identify tomcat instances at run-time


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

Don't hijack threads. Please post a new question to the list.

- -chris

Brian Barnett wrote:
> I have a struts-based application running on multiple tomcat instances, load balanced by a hardware load balancer, i.e., no Apache Web Server. I need a way at run-time to know which tomcat instance it is. Is there a way to access info in the server.xml or context.xml file at run-time? Can I specify some arbitrary value in either of those xml files that would be available at run-time? Is there some other way to identify the tomcat instance at run-time? Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?
> 
> Any ideas would be appreciated.
> 
> Thanks,
> Brian Barnett
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGztJG9CaO5/Lv0PARApqyAJ4kMXAN9wVMarjnz/0XPx6+ZyKoFQCgkrqm
oXqOaGXmC/OFVdo0WY+2erM=
=3Ack
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Need a way to identify tomcat instances at run-time

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

Don't hijack threads. Please post a new question to the list.

- -chris

Brian Barnett wrote:
> I have a struts-based application running on multiple tomcat instances, load balanced by a hardware load balancer, i.e., no Apache Web Server. I need a way at run-time to know which tomcat instance it is. Is there a way to access info in the server.xml or context.xml file at run-time? Can I specify some arbitrary value in either of those xml files that would be available at run-time? Is there some other way to identify the tomcat instance at run-time? Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?
> 
> Any ideas would be appreciated.
> 
> Thanks,
> Brian Barnett
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGztJG9CaO5/Lv0PARApqyAJ4kMXAN9wVMarjnz/0XPx6+ZyKoFQCgkrqm
oXqOaGXmC/OFVdo0WY+2erM=
=3Ack
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: java.net.SocketException: Invalid argument

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron,

Don't hijack threads. Please post a new question to the list.

- -chris

Aaron wrote:
> I am running Tomcat 5.0.28 and Apache 2.2 using mod_jk. I am constantly seeing the following error show up in the catalina.log:
> 
> WARNING: Exception executing accept
> java.net.SocketException: Invalid argument
>         at java.net.PlainSocketImpl.socketSetOption(Native Method)
>         at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:240)
>         at java.net.Socket.setSoLinger(Socket.java:826)
>         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:300)
>         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
>         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:847)
>         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
>         at java.lang.Thread.run(Thread.java:534)
> 
> Is this something that I should be concerned with? I don't see any glaring performance issues with my site, but I still don't like the fact that my logs are filling up with errors. Thanks for your help and input.
> 
> Aaron Steele
> Technology Manager
>  
> Natural Wellness USA, Inc.
> http://www.veria.com
> 701 Highlander Blvd, Suite 200 | Arlington, Texas 76015
> p (817) 804-4646 | c (817) 879-7528 | f (817) 804-4696
> 
> 
> ---------------------------------------------------------------------
> 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
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGztI09CaO5/Lv0PARAg+cAJ0WeOt4LshS8E7L44QqR4KA1QFF4ACeLxrb
aiGKTdwz1ofr0nGVLrV3PLk=
=KeHT
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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


java.net.SocketException: Invalid argument

Posted by Aaron <aa...@veria.com>.
I am running Tomcat 5.0.28 and Apache 2.2 using mod_jk. I am constantly seeing the following error show up in the catalina.log:

WARNING: Exception executing accept
java.net.SocketException: Invalid argument
        at java.net.PlainSocketImpl.socketSetOption(Native Method)
        at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:240)
        at java.net.Socket.setSoLinger(Socket.java:826)
        at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:300)
        at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
        at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:847)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:534)

Is this something that I should be concerned with? I don't see any glaring performance issues with my site, but I still don't like the fact that my logs are filling up with errors. Thanks for your help and input.

Aaron Steele
Technology Manager
 
Natural Wellness USA, Inc.
http://www.veria.com
701 Highlander Blvd, Suite 200 | Arlington, Texas 76015
p (817) 804-4646 | c (817) 879-7528 | f (817) 804-4696


---------------------------------------------------------------------
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: Need a way to identify tomcat instances at run-time

Posted by DJ...@desknetinc.com.
There may be better ways, but one approach which occurs to me is to set 
unique jvmRoute values on the engines in the server.xml.  Even though you 
aren't using mod_jk, this will result in the provided values being 
appended to the sessionid.  Assuming that you are establishing sessions, 
and that your hardware balancer has sticky session logic, so once a 
session is established, the user's subsequent requests get sent to the 
same backend, this would allow you to distinguish which tomcat instance is 
being used when processing a request for a user.  This would be apparent 
within your webapp by examining the sessionid, but also from the client 
side, by examining the jsessionid cookie value.



Please respond to "Tomcat Users List" <us...@tomcat.apache.org>

To:     "Tomcat Users List" <us...@tomcat.apache.org>
cc:      
Subject:        Need a way to identify tomcat instances at run-time


I have a struts-based application running on multiple tomcat instances, 
load balanced by a hardware load balancer, i.e., no Apache Web Server. I 
need a way at run-time to know which tomcat instance it is. Is there a way 
to access info in the server.xml or context.xml file at run-time? Can I 
specify some arbitrary value in either of those xml files that would be 
available at run-time? Is there some other way to identify the tomcat 
instance at run-time? Is there a way to access CATALINA_HOME or 
CATALINA_BASE at run-time?

Any ideas would be appreciated.

Thanks,
Brian Barnett



---------------------------------------------------------------------
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