Hi Peter, as far as I know, tomcat does the following: - starting a webapp for each webapp in tomcat/webapps - starting a webapp for each extra configured webapp from server.xml
My solution was to map the path /myApp to the ROOT webapp and the Path / to the myApp webapp Therefore the default path for /myApp was overridden. I did not test this with tomcat 4.1.x, but you could give it a try. The other solution is, not to put your webapp in the tomcat/webapps directory and configure the path in server.xml. Greetings! Simon peter lin schrieb: > > I've posted this question last week and talked to Remmy, but Remmy is > busy with moving. I spent some time this weekend trying to track down > the bug, but couldn't figure it out. I'm hoping if I describe the bug > more clearly, someone can point me in the right direction. > > The bug is the following: > > If I have server.xml set with all the defaults and I have a > ServletContextListener defined in web.xml, Tomcat correctly creates an > instance of my listener and starts my test application. If I add a > webapp, it also correctly creates an instance of my listener and starts > the test application. > > If on the otherhand I change server.xml to point to a different > directory for the default root path from "ROOT" to say "myapp", Tomcat > ends up creating two separate instances of the listener. Both listeners > get contextInitialized() event and create one instance of my test > application per listener. The correct behavior should be the same as > leaving the root directory to the default "ROOT". > > If I use 4.1.8 and load up the manager, I see webapp "/" and "/myapp". > This explains why two separate instances of my listener are created. I > only want 1 instance of my test application to startup with tomcat, > since it loads global configuration values into memory. > > I looked in catalina.core.StandardContext, but I don't see which class > is responsible for creating the listener listed in web.xml. Is the > behavior of creating two instances of my listener according to > specification? Is there something special about changing the default > root path from "ROOT" to some other "myapp" path? > > peter lin > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>