You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Marinko, Jeff" <Je...@intuit.com> on 2002/07/19 18:08:42 UTC

Resend (again): 4.0.3: Servlets Loaded Twice?

I'm surprised more people haven't run across this issue...resending again
due to lack of response.

Just a quick question...

I've noticed that all Servlets are loaded twice on Tomcat.  I'm running
4.0.3 on Win2K, and just by looking at the output I can see the same servlet
is loaded twice in quick succession (also, HttpServlet.init gets called
twice, but that's from loading twice).  Is this a known bug/feature?  Any
way to get a servlet to load only once (such as those servlets that have a
great deal of initialization)?

Thanks!

Jeff


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Resend (again): 4.0.3: Servlets Loaded Twice?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 19 Jul 2002, Marinko, Jeff wrote:

> Date: Fri, 19 Jul 2002 09:08:42 -0700
> From: "Marinko, Jeff" <Je...@intuit.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: 'Tomcat Users List' <to...@jakarta.apache.org>
> Subject: Resend (again):  4.0.3:  Servlets Loaded Twice?
>
> I'm surprised more people haven't run across this issue...resending again
> due to lack of response.
>
> Just a quick question...
>
> I've noticed that all Servlets are loaded twice on Tomcat.  I'm running
> 4.0.3 on Win2K, and just by looking at the output I can see the same servlet
> is loaded twice in quick succession (also, HttpServlet.init gets called
> twice, but that's from loading twice).  Is this a known bug/feature?  Any
> way to get a servlet to load only once (such as those servlets that have a
> great deal of initialization)?
>

If you are getting servlets loaded twice, your configuration is messed up.
The most likely way to cause this to happen is to have a directory under
webapps (so that it gets automatically deployed) plus a <Context> element
in server.xml that points at the same directory, but with another context
path.  What happens here is that you're initializing two webapps from the
same directory -- and the initialization happens for each of them.

Another way to do this would be to mistakenly have two <servlet> entries
for the same servlet class in your web.xml, but I'm assuming you've
already checked for that.

> Thanks!
>
> Jeff
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>