Thank you for replying.

If the context.xml file is being ignored then why the variable that I have 
defined in the server.xml is not being read? Should I delete the 
META-INF/context.xml file completely?




From:
Konstantin Kolinko <knst.koli...@gmail.com>
To:
Tomcat Users List <users@tomcat.apache.org>
Date:
10/27/2011 05:33 PM
Subject:
Re: context.xml not being read



2011/10/28 Rajkumar Singh <rajkumar.si...@digitas.com>:
> Hello,
>
> I am not able to read the environment variable from the server.xml - 
those
> are also referenced in the META-INF/context.xml.
>
> I am using tomcat version 6.0.29. The tomcat is deployed on the OS Linux
>
> I am deploying my source code in some folder called
> /data2/www/xyz/htdocs/approot. I have pointed the server.xml to read 
from
> /data2/www/xyz/htdocs/approot as follows:
>
> <Host name="xyz.company.com">
>        <Context path="/" docBase="/data2/www/xyz/htdocs/approot"
> reloadable="true" debug="0" override="true" />
> </Host>
>
> Under the "approot" folder I have the WEB-INF and the META-INF folder. 
And
> under the META-INF folder I have the context.xml.
>
> The server.xml has one environment variable as follows:
>
> <Environment name="serverURLPrefix" override="false"
> type="java.lang.String" value="http://xyz.company.com"/>
>
> And in the context.xml the same variable is referenced as
>
> <Context path="/" reloadable="true" debug="0" override="true">
>        <ResourceLink global="serverURLPrefix" name="serverURLPrefix"
> type="java.lang.String"/>
> </Context>
>
> Can please help me in understanding as to why the tomcat is not able to
> read the property "serverURLPrefix"?
>

This behaviour is by design. The <Context> element can be defined only 
once.

You choose to define it in server.xml and thus context.xml file is 
ignored.

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



------------------------------------------------------------------------
Disclaimer 
The information in this email and any attachments may contain proprietary and 
confidential information that is intended for the addressee(s) only. If you are 
not the intended recipient, you are hereby notified that any disclosure, 
copying, distribution, retention or use of the contents of this information is 
prohibited.  When addressed to our clients or vendors, any information 
contained in this e-mail or any attachments is subject to the terms and 
conditions in any governing contract. If you have received this e-mail in 
error, please immediately contact the sender and delete the e-mail.

Reply via email to