You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Arieh Markel <Ar...@central.sun.com> on 2000/11/21 02:08:48 UTC

Problem with context initialization ?

We are running into the following problem:

. we start Tomcat in an embedded manner:

	use a server.xml that only includes interceptors and connectors
	
	create contexts programmatically
	
	initialize the context manager
	

I am observing the following behavior:

  the tomcat is making the ports available before the context finished
  being initialized.
  
  On trying to access the application at that time, we get the following  
    
java.lang.NoClassDefFoundError: com/sun/esm/web/server/ServerUtils
        at com.sun.esm.web.servlet.CMCServlet.service(CMCServlet.java:354)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
        at org.apache.tomcat.core.Handler.service(Handler.java:263)
        at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
        at 
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:787)
        at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:733)
        at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConne
ctionHandler.java:210)
        at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
        at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)
        
 
  From that moment on, we are never able to access the webserver, getting
  the same message again and again.
  
-----

It appears that there is a race condition on the ContextManager.start()
method.

I instrumented my context manager startup to print when the return
from ContextManager.start occurs.

I try to access my initial page (which is actually a servlet)
repeatedly from a browser trying to catch the point in time where
the connector is made available by the contexts are not.

When I manage to access the port on the connector
the result is the above exception.

Does anybody else see something similar ?

-----

Arieh       
--
 Arieh Markel		                Sun Microsystems Inc.
 Network Storage                        500 Eldorado Blvd. MS UBRM11-194
 e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
 Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


Re: Problem with context initialization ?

Posted by cm...@yahoo.com.
Hi Arieh,

I know about this problem, and 3.3 is going to fix this ( and other
similar problems ) by defining a startup order and changing the code 
to implement it.

I don't know any simple fix for 3.2, there is a lot of code that has to be
changed.

Costin 

On Mon, 20 Nov 2000, Arieh Markel wrote:

> We are running into the following problem:
> 
> . we start Tomcat in an embedded manner:
> 
> 	use a server.xml that only includes interceptors and connectors
> 	
> 	create contexts programmatically
> 	
> 	initialize the context manager
> 	
> 
> I am observing the following behavior:
> 
>   the tomcat is making the ports available before the context finished
>   being initialized.
>   
>   On trying to access the application at that time, we get the following  
>     
> java.lang.NoClassDefFoundError: com/sun/esm/web/server/ServerUtils
>         at com.sun.esm.web.servlet.CMCServlet.service(CMCServlet.java:354)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at 
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
>         at org.apache.tomcat.core.Handler.service(Handler.java:263)
>         at 
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
>         at 
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:787)
>         at 
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:733)
>         at 
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConne
> ctionHandler.java:210)
>         at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
>         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
>         
>  
>   From that moment on, we are never able to access the webserver, getting
>   the same message again and again.
>   
> -----
> 
> It appears that there is a race condition on the ContextManager.start()
> method.
> 
> I instrumented my context manager startup to print when the return
> from ContextManager.start occurs.
> 
> I try to access my initial page (which is actually a servlet)
> repeatedly from a browser trying to catch the point in time where
> the connector is made available by the contexts are not.
> 
> When I manage to access the port on the connector
> the result is the above exception.
> 
> Does anybody else see something similar ?
> 
> -----
> 
> Arieh       
> --
>  Arieh Markel		                Sun Microsystems Inc.
>  Network Storage                        500 Eldorado Blvd. MS UBRM11-194
>  e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
>  Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
>  (e-mail me with subject SEND PUBLIC KEY to get public key)
>