Hi there,

2009/4/6 Caldarale, Charles R <chuck.caldar...@unisys.com>:
> The metaphysical implications of existing without a trace are rather 
> intriguing...

Yeah, I was about to call Mulder and Scully to investigate it, but I
thought I'd give the user list a chance first.

> Looks like it.  In Tomcat 5.5, there was a non-daemon thread for each 
> <Connector> named "http-<port>-Monitor"; this thread no longer exists in 6.0, 
> since the whole area appears to have been re-architected.  There are no 
> non-daemon threads in Tomcat 6.0, other than the whatever thread gets the 
> game started; the normal Tomcat bootstrap uses this lead thread to listen on 
> the shutdown port.  You'll need to have some thread hanging around to keep 
> the JVM from terminating; if you don't have such a thread, why are you 
> bothering with embedded?

I usually ran the app with the GUI, but sometimes it is useful to ran
it without, specially during development and testing of new
containers, as I don't have to wait for the Windows to open. I did not
know it was "disallowed". OTOH, if I did not want my app to start
alive, why would I have started a server listening in a port? I use
embedded to test web applications and to run them inside Ant so I can
perform integration tests on them within Ant, so the GUI part is
optional.

>> if I start the server with a GUI window, so the container
>> remains alive due to the GUI thread, stopping the server
>> does not really work, as even though it says that the
>> Connector stopped, I can still access the server for some
>> seconds and then it starts answering "resource not available",
>> but the thing is, it still answers to the port.
>
> It's your responsibility to terminate your GUI thread so the JVM can kill off 
> all the daemon threads.

Do you mean that the stop() method on the Server class is useless and
in order to stop the embedded server I have to kill my whole
application? That doesn't make much sense.

> You really use "this." everywhere?  Seems a bit tedious, to say nothing of 
> making code reviews difficult.

"this" is added automatically by the IDE and in this case, it helps me
distinguish between the objetcs that are created on the start method
and the ones I have to keep a reference to.

> You have to change your code; you got lucky in 5.5.

To me it makes more sense the 5.5 behaviour, but oh well :). In any
case, not being able to stop the server normally without killing my
whole application is really a non-no for me.

> Yes, the doc could be improved here.  You could create a FAQ/Wiki entry based 
> on your findings.

Once I get a clear picture, I'll try to.

>  - Chuck

Thanks for your help,
D.

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

Reply via email to