You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by bhanujirao <du...@gmail.com> on 2009/04/13 19:02:24 UTC

reading jvmRoute property specified in server.xml

Guys,

i have the following property set in server.xml.  i need to read  jvmRoute
in my web app. Can someone please suggestion how to read this property in
java class ?


>

Thanks in advance
venky


-- 
View this message in context: http://www.nabble.com/reading--jvmRoute-property-specified-in-server.xml-tp23024883p23024883.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

Re: reading jvmRoute property specified in server.xml

Posted by Pid <pi...@pidster.com>.
On 1/7/11 11:10 AM, loteq wrote:
> 
> Hi 
> 
> I have the same problem. I need to read the jvmRoute property of the tomcat
> engine, but I have no access to the request, because I am in a Quartz
> thread.
> 
> Has anyone solved this issue?

I don't know how old the thread you're replying to is, but I would
appendthe following in catalina.properties:

 jvm.route=tomcat12345

and then in server.xml, put:

 <Engine ... jvmRoute="${jvm.route}"

You'll be able to read the value from the System properties.


p


> bhanujirao wrote:
>>
>> We have Quartz jobs running in back ground. It needs to know whether this
>> instance has to run the job
>> or not. Earlier we use to catilina.base which we can read as System
>> property . now all the servers have
>> the same instance names..so i am just thinking is there any way this
>> property will help to get the unique name to find out the instance. 
>>
>> currently i have resolved this by the combination of catilina.base with
>> java.net.InetAddress.getLocalHost().getHostName()  which makes unique..
>>
>>  
>>
>>
>> Caldarale, Charles R wrote:
>>>
>>>> From: bhanujirao [mailto:dumpala.venkata@gmail.com]
>>>> Subject: RE: reading jvmRoute property specified in server.xml
>>>>
>>>> i need to read it in java class which i dont have access 
>>>> to HttpServletRequest
>>>
>>> So what does this Java class have access to?  If you'd provide
>>> information about what you *are* doing (as opposed to what you're *not*
>>> doing), it would help.  Playing twenty questions isn't that much fun.
>>>
>>>  - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>>
> 


RE: reading jvmRoute property specified in server.xml

Posted by loteq <ne...@gmail.com>.
Hi 

I have the same problem. I need to read the jvmRoute property of the tomcat
engine, but I have no access to the request, because I am in a Quartz
thread.

Has anyone solved this issue?

Thanks,

Luis



bhanujirao wrote:
> 
> We have Quartz jobs running in back ground. It needs to know whether this
> instance has to run the job
> or not. Earlier we use to catilina.base which we can read as System
> property . now all the servers have
> the same instance names..so i am just thinking is there any way this
> property will help to get the unique name to find out the instance. 
> 
> currently i have resolved this by the combination of catilina.base with
> java.net.InetAddress.getLocalHost().getHostName()  which makes unique..
> 
>  
> 
> 
> Caldarale, Charles R wrote:
>> 
>>> From: bhanujirao [mailto:dumpala.venkata@gmail.com]
>>> Subject: RE: reading jvmRoute property specified in server.xml
>>> 
>>> i need to read it in java class which i dont have access 
>>> to HttpServletRequest
>> 
>> So what does this Java class have access to?  If you'd provide
>> information about what you *are* doing (as opposed to what you're *not*
>> doing), it would help.  Playing twenty questions isn't that much fun.
>> 
>>  - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/reading--jvmRoute-property-specified-in-server.xml-tp23024883p30613231.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: reading jvmRoute property specified in server.xml

Posted by bhanujirao <du...@gmail.com>.
We have Quartz jobs running in back ground. It needs to know whether this
instance has to run the job
or not. Earlier we use to catilina.base which we can read as System property
. now all the servers have
the same instance names..so i am just thinking is there any way this
property will help to get the unique name to find out the instance. 

currently i have resolved this by the combination of catilina.base with
java.net.InetAddress.getLocalHost().getHostName()  which makes unique..

 


Caldarale, Charles R wrote:
> 
>> From: bhanujirao [mailto:dumpala.venkata@gmail.com]
>> Subject: RE: reading jvmRoute property specified in server.xml
>> 
>> i need to read it in java class which i dont have access 
>> to HttpServletRequest
> 
> So what does this Java class have access to?  If you'd provide information
> about what you *are* doing (as opposed to what you're *not* doing), it
> would help.  Playing twenty questions isn't that much fun.
> 
>  - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/reading--jvmRoute-property-specified-in-server.xml-tp23024883p23032458.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: reading jvmRoute property specified in server.xml

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: bhanujirao [mailto:dumpala.venkata@gmail.com]
> Subject: RE: reading jvmRoute property specified in server.xml
> 
> i need to read it in java class which i dont have access 
> to HttpServletRequest

So what does this Java class have access to?  If you'd provide information about what you *are* doing (as opposed to what you're *not* doing), it would help.  Playing twenty questions isn't that much fun.

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: reading jvmRoute property specified in server.xml

Posted by bhanujirao <du...@gmail.com>.
Well thanks for ur reply.. i know that is one alternative but i need to read
it in java class which i dont have access to HttpServletRequest .. any other
alternative...

Thanks
Venkat

Caldarale, Charles R wrote:
> 
>> From: bhanujirao [mailto:dumpala.venkata@gmail.com]
>> Subject: reading jvmRoute property specified in server.xml
>> 
>> i need to read jvmRoute in my web app.
> 
> It should be part of the session id; if your code is running in a servlet,
> try:
> 
>     HttpServletRequest.getSession().getId()
> 
> and parse it out.
> 
>  - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/reading--jvmRoute-property-specified-in-server.xml-tp23024883p23032280.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: reading jvmRoute property specified in server.xml

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: bhanujirao [mailto:dumpala.venkata@gmail.com]
> Subject: reading jvmRoute property specified in server.xml
> 
> i need to read jvmRoute in my web app.

It should be part of the session id; if your code is running in a servlet, try:

    HttpServletRequest.getSession().getId()

and parse it out.

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org