You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by chris derham <ch...@derham.me.uk> on 2011/01/26 15:44:24 UTC

Problem with overriding parameters via context.xml

All,

I appear to have an issue with tomcat 6.0.30 not allowed web.xml parameters
to be over-ridden via context.xml file entries. This works fine in tomcat
6.0.29.

I have a parameter defined in web.xml, like this

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>WEB-INF/classes/log4j.dev.xml</param-value>
    </context-param>

Then in context.xml I wish to override this parameter in different
deployment environments. So I create a context.xml file in
catalina_base\conf\context.xml containing the following

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <Parameter name="log4jConfigLocation"
value="WEB-INF/classes/log4j.uat.xml" override="false"/>
</Context>

I then have a jsp file that contains the following

<%@ page contentType="text/html; charset=UTF-8" %>
<html>
<body>
<br>log4jConfigLocation is : ${initParam.log4jConfigLocation}
</body>
</html>

Using 6.0.29 the jsp shows the value present in the context.xml file, e.g.
expected behaviour. In 6.0.30 the value from the web.xml file is shown, e.g.
the required override hasn't happened.

I have read the release notes, and can't see anything that jumps out to me
saying that this behaviour has changed. Is this a defect in tomcat, or a
desired change or behaviour? If the latter, can anyone provide any pointers
as to how I can achieve my stated goal? My only current work around is to
revert to 6.0.29

Thanks

Chris

Re: Problem with overriding parameters via context.xml

Posted by Rainer Frey <ra...@inxmail.de>.
On Monday 28 February 2011 16:53:00 Mark Thomas wrote:
> On 28/02/2011 14:51, Rainer Frey wrote:
> > On Friday 25 February 2011 17:21:07 Mark Thomas wrote:
> >> 6.0.33 is likely to be several months away. I don't see anything in the
> >> change log that is likely to prompt an earlier release.
> > 
> > Ouch. 50700 is an absolute blocker for me. I'm stuck with 6.0.29 because
> > of this, and having a useable release with the numerous fixes from
> > 6.0.30 would be good.
> 
> What's wrong with 7.0.9? I am in the processing of uploading the files
> for the release vote now. The ASF Jira instance has been happily running
> 7.0.x since 7.0.6 was announced as stable.

I plan to test with Tomcat 7, but some apps did not work well with the beta 
versions (IIRC because of using incorrect URL mappings that did work in Tomcat 
6).

Rainer

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


Re: Problem with overriding parameters via context.xml

Posted by Mark Thomas <ma...@apache.org>.
On 28/02/2011 14:51, Rainer Frey wrote:
> On Friday 25 February 2011 17:21:07 Mark Thomas wrote:
>> On 25/02/2011 16:14, chris derham wrote:
>>> Oliver said that the defect I was asking about was 50700. This appears to
>>> have been fixed now. So when is the next release of tomcat scheduled? I
>>> searched the tomcat pages, but can't see a page listing anticipated
>>> launch dates. I know open source projects don't tend to be so rigid, but
>>> is there a date penciled in?
>>
>> 7.0.9 probably in the next few weeks. I have been trying to stick to a
>> release every month or so.
>>
>> 6.0.33 is likely to be several months away. I don't see anything in the
>> change log that is likely to prompt an earlier release.
> 
> Ouch. 50700 is an absolute blocker for me. I'm stuck with 6.0.29 because of 
> this, and having a useable release with the numerous fixes from 6.0.30 would 
> be good.

What's wrong with 7.0.9? I am in the processing of uploading the files
for the release vote now. The ASF Jira instance has been happily running
7.0.x since 7.0.6 was announced as stable.

Mark

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


Re: Problem with overriding parameters via context.xml

Posted by Rainer Frey <ra...@inxmail.de>.
On Friday 25 February 2011 17:21:07 Mark Thomas wrote:
> On 25/02/2011 16:14, chris derham wrote:
> > Oliver said that the defect I was asking about was 50700. This appears to
> > have been fixed now. So when is the next release of tomcat scheduled? I
> > searched the tomcat pages, but can't see a page listing anticipated
> > launch dates. I know open source projects don't tend to be so rigid, but
> > is there a date penciled in?
> 
> 7.0.9 probably in the next few weeks. I have been trying to stick to a
> release every month or so.
> 
> 6.0.33 is likely to be several months away. I don't see anything in the
> change log that is likely to prompt an earlier release.

Ouch. 50700 is an absolute blocker for me. I'm stuck with 6.0.29 because of 
this, and having a useable release with the numerous fixes from 6.0.30 would 
be good.

> Mark

Rainer

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


Re: Problem with overriding parameters via context.xml

Posted by Mark Thomas <ma...@apache.org>.
On 25/02/2011 16:14, chris derham wrote:
> Oliver said that the defect I was asking about was 50700. This appears to
> have been fixed now. So when is the next release of tomcat scheduled? I
> searched the tomcat pages, but can't see a page listing anticipated launch
> dates. I know open source projects don't tend to be so rigid, but is there a
> date penciled in?

7.0.9 probably in the next few weeks. I have been trying to stick to a
release every month or so.

6.0.33 is likely to be several months away. I don't see anything in the
change log that is likely to prompt an earlier release.

Mark

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


Re: Problem with overriding parameters via context.xml

Posted by chris derham <ch...@derham.me.uk>.
On Fri, Feb 4, 2011 at 4:58 PM, Oliver Doepner <od...@gmail.com> wrote:

>
> Hi,
>
> This looks like a symptom of this:
>
> Bug 50700 – Context parameters are being overridden with parameters from
> the
> web application deployment descriptor
> https://issues.apache.org/bugzilla/show_bug.cgi?id=50700
>
> Please vote for this bug and/or provide additional information in the bug
> comments.
>
> cheers
> Oliver
>

Oliver said that the defect I was asking about was 50700. This appears to
have been fixed now. So when is the next release of tomcat scheduled? I
searched the tomcat pages, but can't see a page listing anticipated launch
dates. I know open source projects don't tend to be so rigid, but is there a
date penciled in?

Thanks

Chris

Re: Problem with overriding parameters via context.xml

Posted by Oliver Doepner <od...@gmail.com>.
Hi,

This looks like a symptom of this:

Bug 50700 – Context parameters are being overridden with parameters from the
web application deployment descriptor
https://issues.apache.org/bugzilla/show_bug.cgi?id=50700

Please vote for this bug and/or provide additional information in the bug
comments.

cheers
Oliver

-----
Oliver Doepner
http://doepner.net/
-- 
View this message in context: http://old.nabble.com/Problem-with-overriding-parameters-via-context.xml-tp30768075p30847170.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: Problem with overriding parameters via context.xml

Posted by chris derham <ch...@derham.me.uk>.
Chuck,

Thanks for your quick response. I have tried placing the context.xml file in
the location you suggested and no change.

I didn't mention in m original post, but our context.xml also contains
resource definitions to connect to the database/smtp server. These settings
are being picked up fine - its just the parameters that seem to have changed
behaviour moving from 6.0.29 to 6.0.30

Thanks

Chris

On Wed, Jan 26, 2011 at 1:02 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: cjderham@gmail.com [mailto:cjderham@gmail.com] On Behalf Of chris
> derham
> > Subject: Problem with overriding parameters via context.xml
>
> > So I create a context.xml file in catalina_base\conf\context.xml
> > containing the following
>
> That could be a problem.  The context.xml file in the conf directory is the
> global one, containing the default settings for _all_ webapps.  It would be
> better (perhaps required) to place the specific attributes in the <Context>
> element for the webapp of interest, either in the webapp's
> META-INF/context.xml file, or in conf/Catalina/[host]/[appName].xml.
>
>  - 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: Problem with overriding parameters via context.xml

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: cjderham@gmail.com [mailto:cjderham@gmail.com] On Behalf Of chris derham
> Subject: Problem with overriding parameters via context.xml

> So I create a context.xml file in catalina_base\conf\context.xml
> containing the following

That could be a problem.  The context.xml file in the conf directory is the global one, containing the default settings for _all_ webapps.  It would be better (perhaps required) to place the specific attributes in the <Context> element for the webapp of interest, either in the webapp's META-INF/context.xml file, or in conf/Catalina/[host]/[appName].xml.  

 - 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