tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject Re: Tomcat-5.0.7 - FileLogger of Embedded attempts two start() calls and fails on the second.
Date Tue, 12 Aug 2003 09:02:34 GMT
Wesley Hall wrote:

> To demonstrate this problem, i have created a subclass of FileLogger with
> the start() method overriden to print a stack whenever it is called. The
> result is this...
> 
> java.lang.Exception: Start has been called
> 	at
> org.antares.tomcat.TomcatService$TestFileLogger.start(TomcatService.java:312
> )
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1113)
> 	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:502)
> 	at org.apache.catalina.startup.Embedded.start(Embedded.java:1026)
> 	at org.antares.tomcat.TomcatService.start(TomcatService.java:236)
> 	at org.antares.tomcat.TomcatService.main(TomcatService.java:324)
> java.lang.Exception: Start has been called
> 	at
> org.antares.tomcat.TomcatService$TestFileLogger.start(TomcatService.java:312
> )
> 	at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3926)
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1127)
> 	at org.apache.catalina.core.StandardHost.start(StandardHost.java:792)
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1127)
> 	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:502)
> 	at org.apache.catalina.startup.Embedded.start(Embedded.java:1026)
> 	at org.antares.tomcat.TomcatService.start(TomcatService.java:236)
> 	at org.antares.tomcat.TomcatService.main(TomcatService.java:324)
> 
> As you can see, there is only one call to Embedded.start but this results in
> two calls attempting to start the logger.
> 
> The second call causes the Logger to throw a LifecycleException and the
> server fails to start. The only solution i can find so far is not adding the
> logger in the first place.
> 
> This wasnt a problem in 4.1.27.

Your logger seems associated with both the host and the engine (and it 
gets started by both, of course). Setting the logger to the engine only 
would work ok (it's not your fault, Embedded does it for you in 
createContext, which is incorrect; somehow, it doesn't do it in createHost).

Can you test and debug this further ?

Remy



Mime
View raw message