Bug 47516

Summary: parameters in conf/context.xml and context.xml.default are ignored
Product: Tomcat 6 Reporter: Wim Goossens <wg>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: wg
Priority: P2    
Version: 6.0.32   
Target Milestone: default   
Hardware: All   
OS: All   

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