----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

I'm running JServ 1.1.2 (original download was ApacheJServ-1.1.2-2.exe)
and Apache 1.3.14 on Windows NT 4.  I have a servlet whose destroy method
must be invoked when Apache is shutdown.  At present, the servlet's destroy method
isn't being called when Apache is shutdown.  

In jserv.conf I've got:

ApJServLogLevel info

and in jserv.properties

log.channel.info=true
log.channel.servletException=true
log.channel.jservException=true
log.channel.warning=true
log.channel.servletLog=true
log.channel.critical=true
log.channel.debug=true

When I shutdown Apache, the following messages appear in mod_jserv.log:

[30/01/2001 21:40:33:276] (INFO) wrapper: controller started (PID=363)
[31/01/2001 04:00:34:092] (INFO) wrapper: Shutdown done (PID=394)
[31/01/2001 04:00:34:112] (INFO) Apache Module was cleaned-up
[31/01/2001 04:00:39:490] (INFO) wrapper: thread did not end, terminating it
[31/01/2001 04:00:39:490] (INFO) wrapper: controller thread stopped
[31/01/2001 04:00:39:490] (INFO) wrapper: Java Virtual Machine still alive after 
controller kill
[31/01/2001 04:00:39:490] (INFO) wrapper: Java Virtual Machine stopped
[31/01/2001 04:00:39:490] (INFO) wrapper: Shutdown done (PID=363)
[31/01/2001 04:00:39:490] (INFO) Apache Module was cleaned-up

There are no (INFO) messages from wrapper_controller (in jserv_wrapper_win.c),
which is the only place that actually forwards a JSERV_SHUTDOWN control message 
to the Java process acting as the servlet engine.  Also, there are no messages
at all in the jserv.log file relating to the shutdown (which also indicates)
that the shutdown message doesn't get through to the Java process.
Most of the messages in the above extract are generated in wrapper_destroy,
which starts with:

int wrapper_destroy (wrapper_config *cfg) {
    int ret;

    /* Check our thread status and terminate it */
    if (wrapper_thread!=NULL) {
        if (wrapper_event!=NULL) {
            /* Post the quit message */
            SetEvent(wrapper_event);

            /* Wait 5 second for thread and process to terminate */
            ret=WaitForSingleObject(wrapper_thread,5000);

            /* Wait did not go thru... terminate the thread */
            if (ret!=WAIT_OBJECT_0) {
                TerminateThread(wrapper_thread,0);
                jserv_error(JSERV_LOG_INFO,cfg->config,"wrapper: %s",
                            "thread did not end, terminating it");
            }

So it seems that the SetEvent(wrapper_event) call is the one intended
to cause the JSERV_SHUTDOWN message to be sent, but it's not happening.
I guess that SetEvent is a call back into Apache proper---perhaps the
event loop has been disabled at this point in the shutdown process
which is why nothing happens.

Anyway, any help in getting destroy called at Apache shutdown would
be much appreciated.

Thanks, Paul.
-- 
Paul Ashton
Tourplan Pacific
Christchurch, New Zealand



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to