aspose file tools*
The moose likes Tomcat and the fly likes ContextIntialized executed twice when Tomcat started from Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "ContextIntialized executed twice when Tomcat started from Eclipse" Watch "ContextIntialized executed twice when Tomcat started from Eclipse" New topic
Author

ContextIntialized executed twice when Tomcat started from Eclipse

Dan Arbo
Greenhorn

Joined: Jul 04, 2011
Posts: 22
Hi all,

I am not a Tomcat expert - I am just using it in Eclipse to develop my application.

When I start it, I have just realised that the listener which has code to execute when I start Tomcat is executed twice.

I read somewhere that there was a bug in a couple of versions of Tomcat in which it happened, but I believe it must have something to do with my local environment because

- when I upload my application to the web host and I start it, it doesn't happen.
- I tried different versions of Tomcat locally ( 6.0.35 and 7.0.26 and another one which I can't remember ) and it always happens.

I haven't played with the configuration files at all - I have just unzipped the Tomcat folder and linked to it from Eclipse.

Can anybody suggest where it ( or I? ) could be going wrong?

Thanks, Dan
Dan Arbo
Greenhorn

Joined: Jul 04, 2011
Posts: 22
This solution worked for me:

In Tomcat's server.xml, I commented out this line and now it all works as it should.



changed to



If your original line contains the contaning tag for HOST, make sure you leave that out of the comment.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ContextIntialized executed twice when Tomcat started from Eclipse