Hi,

I'm fighting a lifecycle problem at the moment.
When stopping and then restarting the examples, I get :

001-06-13 18:52:00 ContextConfig[/examples] Configuration error in default
web.xml
java.lang.IllegalArgumentException: addChild:  Child name 'default' is not
unique
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
 at
org.apache.catalina.core.StandardContext.addChild(StandardContext.java:1195)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.catalina.util.xml.AddChild.end(XmlMapper.java:806)
[...]
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:108)
 at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
 at
org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:7
27)
 at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:818)
 at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:
216)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3173)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:757)
 at
org.apache.catalina.servlets.HTMLManagerServlet.start(HTMLManagerServlet.jav
a:375)
 at
org.apache.catalina.servlets.HTMLManagerServlet.doGet(HTMLManagerServlet.jav
a:137)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[...]

The context config kicks in, and starts trying to add child wrappers which
are already there.
There's also the problem that the web.xml file could have modified, and the
context may contain stale info (like security constraints, ...).

I think we have to recycle the context object to solve this ... The
context's stop() method could be the right place to do it. Or we could also
do it in the ContextConfig (which listens to the events).

Remy

Reply via email to