tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Schönhaber <mailing-tomcat-u...@schoenhaber.de>
Subject Re: Preload of servlet does not work with Tomcat 5.5.15
Date Mon, 24 Apr 2006 10:33:56 GMT
Tom Bednarz wrote:
> Markus Schönhaber wrote:
> >WAG: maybe you did overload GenericServlet#init instead of overriding it.
> > But I doubt that anyone can tell for sure with so little information
> > provided.
>
> Don't know what you mean with that. Here is part of my servlet code:
>
> public final class MTWInit
>     extends HttpServlet
>     implements Runnable
> {
>     .......
>     public void init(ServletConfig config) throws ServletException
>     {
>         super.init(config);
[...]

OK, you did override GenericServlet#init(ServletConfig).

I created a minimal webapp using the web.xml snippet from your OP (classname 
adjusted) and a servlet containing this init-method:

	@Override
	public void init(ServletConfig config) throws ServletException
	{
		super.init(config);
		System.out.println("init called");
	}

On server startup or redeployment of the webapp, "init called" will appear in 
catalina.out. In other words: it works just fine for me.

The only other obious reason I can think of why it might not work for you is 
that you got the classname/packetname wrong in your web.xml's <servlet-class> 
element. But you have undoubtedly already checked that.
So I'm out of ideas.

Regards
  mks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message