Bug 47516 - parameters in conf/context.xml and context.xml.default are ignored
Summary: parameters in conf/context.xml and context.xml.default are ignored
Status: RESOLVED DUPLICATE of bug 50700
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 6.0.32
Hardware: All All
: P2 blocker (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-13 00:47 UTC by Wim Goossens
Modified: 2014-02-17 13:58 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Goossens 2009-07-13 00:47:21 UTC
<ResourceLink> <Environment> <Transaction>

All these tags defined in conf/context.xml and host/context.xml.default are totally ignored. If specified in each applications context.xml it is ok.

Tested on windows vista and linux

Am i missing something somewhere ?
Comment 1 Wim Goossens 2009-07-13 00:54:40 UTC
tested with directory deployment
Comment 2 Mark Thomas 2009-12-10 14:08:48 UTC
This works for me in 6.0.x and trunk. Looks like a configuration problem. Please use the users list for assistance.
Comment 3 Wim Goossens 2010-03-19 07:09:01 UTC
It does NOT work in ALL versions since 6.0.20 --> 6.0.26

elements in $CATALINA_BASE/conf/context.xml 
or in $CATALINA_BASE/conf/[enginename]/[hostname]/context.xml.default
ARE NO LONGER available for the webapps.
 
According to the documentation and the behavior until 6.0.18, they should be available for all the webapps (or for de webapps of that host) 
 
I TESTED it with resourcelinks, transaction and environment elements.
Tested on VISTA and REDHAT.
 
Example :

 <Environment name="test" 
    value="host001"
    type="java.lang.String" 
    override="true" />
 
<ResourceLink name="mail"
   global="mail/Session"
   type="javax.mail.Session" />   
 
 <ResourceLink name="db"
    global="jdbc/dev1"
    type="javax.sql.DataSource" /> 
 
<Transaction factory="com.atomikos.icatch.jta.UserTransactionFactory" />


Only workaround is to copy these elements to each and every webapp.
This is not the intention if you look at the Tomcat documentation.
Comment 4 Martin Harm 2011-07-13 12:22:36 UTC
Parameters with override="false" in Context-Files dont overrule the <context-param> in the corresponding web-app.
See: 
 org.apache.catalina.core.StandardContext.mergeParameters() 
  --> set (twice) on the context and override property is honored 
but will be ignored, because in 
  org.apache.catalina.core.ApplicationContext.setInitParameter(...)
the value wont change
Comment 5 Konstantin Kolinko 2011-07-13 12:35:10 UTC
The issue in 6.0.32 is known and already fixed in 7.0 since 7.0.9 and 6.0.33 (not yet released) - see bug 50700.

Cannot comment about the old WORKSFORME issue that was reported for 6.0.26.

*** This bug has been marked as a duplicate of bug 50700 ***