Hi,

first I have to add that I connect to my webapp through apache mod_jk using
the JK (1) connector with load balancing feature enabled. I did not think
this was important but searching the list I have found a thread where
someone said there is a bug with connecting through apache with the
autoReload feature enabled. However as I already wrote I have the autoRelaod
feature set to false in my app so I don't know if this has anything to do
with it. Moreover the problem only arises when I start a tomcat on either of
the load involved balanced machines - apache doesn't get restartet, it
communicates the reachability by itself as requests come in - and I do not
send any requests that might cause additional initialisation.

To Yoav : I have tried both exploded dir structure and .war file, but of
course not at the same time. The effect is as I described, that with normal
.class files the Listener just gets started twice but with war (or jar,
doesn't matter) the whole thing just crashes on second call with seg fault.
I have a <Context> element in my server.xml (I also tried to put it in
individual file inside my webapp, this doesn't make a difference). But as I
wrote I have the surrounding <Host> set to autoDeploy=false. Also the
<Context> is set to autoReload=false so I my eyes the webapp should be
deployed once at startup and only once, right?

I was only able to find threads dealing with similar issues on this list
that did not reach a satisfiable solution - but with people wanting to dive
into the source ... so hopefully in the meantime someone did find anything
helpful?


Thanks in advance for any suggestions
Tobi

----- Original Message -----
From: "Shapira, Yoav" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Friday, January 10, 2003 3:03 PM
Subject: RE: ServletContextListener started 2 times


Hi,
Do you have both a .war file or your webapp and an exploded directory
structure for it?  Do you have a <Context> element for your context in
the server.xml file?  Either of those can cause double initialization
under some circumstances, and then you'd see listeners instantiated
twice, load-on-startup servlet's init() methods being called twice,
filters initialized twice, etc.

If so, try commenting out the <context> element for your context in
server.xml, and ensuring you have either a .war file or an exploded
directory structure for your webapp, but not both.

There have been issues with this in the past: searching the list
archives may yield more information.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Tobias Dittrich [mailto:[EMAIL PROTECTED]]
>Sent: Friday, January 10, 2003 2:35 AM
>To: Tomcat Users List
>Subject: ServletContextListener started 2 times
>
>Hi,
>
>I have the following problem on tomcat 4.1.18: I defined a
>ServletContextListener in the web.xml for my webapp so I can do some
>initializing stuff when my webapp is startet. Now when I start tomcat
>everything is just fine, the Listener gets notified and starts my
config.
>But after a few moments the webapp seems to be loaded again. A complete
new
>instance of my Listener class is created and notified again (I am
setting
>flags if config is loaded etc but these are unset)..
>I have set the Context to not reload in the server xml and the Host has
>autoDeply false.
>
>As this would not be such a big flaw alone, there is something that
makes
>it
>very bad: if I do not use unzipped classes for my application but put
the
>contents in a jar file under WEB-INF/lib, tomcat always runs into a
>segmentation fault on second startup of my Listener class.
>
>Any suggestions why tomcat is loading my Listener class twice on
startup
>and
>if this is a feature or a bug? Any help would be appreciated.
>
>Thanks
>Tobi
>
>
>--
>To unsubscribe, e-mail:   <mailto:tomcat-user-
>[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:tomcat-user-
>[EMAIL PROTECTED]>


--
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]>

Reply via email to