https://bz.apache.org/bugzilla/show_bug.cgi?id=62786

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
When a Context is defined in a dedicated file the order of events is:
a) Create Context object
b) configure from conf/context.xml
c) update configuration from dedicated file

When a Context is defined in server.xml the order of events is:
1) Create Context object
2) configure from server.xml
3) update configuration from conf/context.xml

Ideally, we want to swap 2) and 3).

Note: - b, c and 3 happen in ContextConfig
      - Defining Contexts in server.xml is strongly discouraged
      - This problem is not limited to Resources. It applies equally to
        any Context configuration.

Re-ordering 2) and 3) is tricky as 1) and 2) happen in the digester while
server.xml is being parsed. Changing the order is possible but would be very
invasive.

It is already possible to disable 3) by setting override="true" in the Context
defined in server.xml (although that does mean all settings from
conf/context.xml will be ignored).

We could change the default of override for Context's defined in server.xml but
I am concerned that that will break existing configurations. E.g. where
resources are defined only in conf/context.xml to make common resources
available to multiple web applications.

I'm currently leaning towards addressing this issue with a documentation
change.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to