tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [T4] Lifecycle problem
Date Thu, 14 Jun 2001 03:07:53 GMT


On Wed, 13 Jun 2001, Remy Maucherat wrote:

> 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).
> 

Can we accomplish this by erasing all the defined servlets, servlet
mappings, MIME mappings, security constraints, and so on?  Recycling the
Context object would mean we're impacting the surrounding environment
(i.e. the Host objects that contain those Contexts) as well.

> Remy
> 
> 

Craig



Mime
View raw message