Re: Why tomcat NT service get killed when the user log off

2000-11-19 Thread Steve Ruby

This problem ONLY happens on 1.3

Sherman Mohler wrote:
> 
> You say this is a problem with Java 1.3. Will Java 1.2 work correctly ? I am
> about to install and start testing TomCat, and was about to use 1.3 ...
> 
> Regards,
> 
> -- Sherman Mohler
> 
> Nacho wrote:
> 
> > Brett can you contributeyour solution to this problem tojakarta??
> >
> > or at least send me thesources or binaries :-) is the better  more
> > elegant solution to this problem i've seen,
> >
> > if you can contribute this i'll be glad to commit it to tomcat 3.3 and
> > 4.0
> >
> > of course giving you credits as the rules mandate ;-)
> >
> > Saludos ,
> > Ignacio J. Ortega
> >
> > -Mensaje original-
> > De: Brett Bergquist [mailto:[EMAIL PROTECTED]]
> > Enviado el: jueves 16 de noviembre de 2000 1:01
> > Para: [EMAIL PROTECTED]
> > Asunto: RE: Why tomcat NT service get killed when the user log off
> >
> > Zhiping, even though jk_nt_service is being used to launch Tomcat, there
> > is a bug in the Java 1.3 runtime under Windows that causes any java.exe
> > process to be terminated when the user logs off. The bug is that a
> > console control handler is setup inside of the java runtime that detects
> > the CTRL_LOGOFF_EVENT that is sent by Windows to each process when the
> > user logs off and the handler inside of Java 1.3 is terminating the
> > process when this occurs. This is the correct operation for a normal
> > application running but not the correct one for a service.
> >
> > There is a couple of packages around, one being located at
> > http://www.kcmultimedia.com/javaserv another at
> > http://www.eworksmart.com/jnt that handle the CTRL_LOGOFF_EVENT. I tried
> > a couple of these and while I found that they indeed to stop the
> > application from being terminated by the CTRL_LOGOFF_EVENT, I found that
> > they interferred with the normal shutdown of Tomcat. That is, using
> > these packages, I was not able to shutdown Tomcat cleanly, which caused
> > the servlets to not have their "destroy" method invoked.
> >
> > The reason that this occurs is because the way that these packages work
> > is that they invoke the Java VM using the JNI interface. When Tomcat is
> > to be shutdown, the same JNI interface is used to invoke a shutdown
> > method. The problem occurs because the way that Tomcat (3.x) is shutdown
> > is by using the APJ interface to send the existing Tomcat instance a APJ
> > shutdown message (through a TCP connection in fact). These packages send
> > the APJ message using the JNI interface, but when call returns, they
> > assume that Tomcat is ready to be shutdown and they then tear down the
> > Java VM running the Tomcat process. In reality, the Tomcat process has
> > not yet received the APJ message through its socket interface and as
> > such has not shutdown cleanly and does not give the servlets a chance to
> > have their "destroy" method called.
> >
> > Because my application needs to have the servlet's "destroy" method
> > called when Tomcat shuts down, I solved this problem by using the source
> > to "java.exe" launcher as a starting point and then modified it to
> > install a console control handler that ignores the CTRL_LOGOFF_EVENT. I
> > called this new launcher "javaex.exe". I then used jk_nt_service and
> > changed the configuration file references of "java.exe" to "javaex.exe".
> >
> > I hope this helps.
> >
> > -Original Message-
> > From: Zhiping Wei [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, November 15, 2000 5:38 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: Why tomcat NT service get killed when the user log off
> >
> > Please Help!!!
> > This is for tomcat 3.2 beta 7 on Windows NT/2000. Tomcat is registed as
> > an NT service using 'jk_nt_service.exe' (under Systemlocal account).
> > It's starts fine but if I log off the windows, tomcat get killed which
> > is not suppose to be. Could anybody tell me why this happen and how to
> > fix it.
> > -- Zhiping (ext: 307)



Re: Why tomcat NT service get killed when the user log off

2000-11-19 Thread Sherman Mohler

You say this is a problem with Java 1.3. Will Java 1.2 work correctly ? I am
about to install and start testing TomCat, and was about to use 1.3 ...

Regards,

-- Sherman Mohler


Nacho wrote:

> Brett can you contributeyour solution to this problem tojakarta??
>
> or at least send me thesources or binaries :-) is the better  more
> elegant solution to this problem i've seen,
>
> if you can contribute this i'll be glad to commit it to tomcat 3.3 and
> 4.0
>
> of course giving you credits as the rules mandate ;-)
>
> Saludos ,
> Ignacio J. Ortega
>
> -Mensaje original-
> De: Brett Bergquist [mailto:[EMAIL PROTECTED]]
> Enviado el: jueves 16 de noviembre de 2000 1:01
> Para: [EMAIL PROTECTED]
> Asunto: RE: Why tomcat NT service get killed when the user log off
>
> Zhiping, even though jk_nt_service is being used to launch Tomcat, there
> is a bug in the Java 1.3 runtime under Windows that causes any java.exe
> process to be terminated when the user logs off. The bug is that a
> console control handler is setup inside of the java runtime that detects
> the CTRL_LOGOFF_EVENT that is sent by Windows to each process when the
> user logs off and the handler inside of Java 1.3 is terminating the
> process when this occurs. This is the correct operation for a normal
> application running but not the correct one for a service.
>
> There is a couple of packages around, one being located at
> http://www.kcmultimedia.com/javaserv another at
> http://www.eworksmart.com/jnt that handle the CTRL_LOGOFF_EVENT. I tried
> a couple of these and while I found that they indeed to stop the
> application from being terminated by the CTRL_LOGOFF_EVENT, I found that
> they interferred with the normal shutdown of Tomcat. That is, using
> these packages, I was not able to shutdown Tomcat cleanly, which caused
> the servlets to not have their "destroy" method invoked.
>
> The reason that this occurs is because the way that these packages work
> is that they invoke the Java VM using the JNI interface. When Tomcat is
> to be shutdown, the same JNI interface is used to invoke a shutdown
> method. The problem occurs because the way that Tomcat (3.x) is shutdown
> is by using the APJ interface to send the existing Tomcat instance a APJ
> shutdown message (through a TCP connection in fact). These packages send
> the APJ message using the JNI interface, but when call returns, they
> assume that Tomcat is ready to be shutdown and they then tear down the
> Java VM running the Tomcat process. In reality, the Tomcat process has
> not yet received the APJ message through its socket interface and as
> such has not shutdown cleanly and does not give the servlets a chance to
> have their "destroy" method called.
>
> Because my application needs to have the servlet's "destroy" method
> called when Tomcat shuts down, I solved this problem by using the source
> to "java.exe" launcher as a starting point and then modified it to
> install a console control handler that ignores the CTRL_LOGOFF_EVENT. I
> called this new launcher "javaex.exe". I then used jk_nt_service and
> changed the configuration file references of "java.exe" to "javaex.exe".
>
> I hope this helps.
>
> -Original Message-
> From: Zhiping Wei [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 15, 2000 5:38 PM
> To: '[EMAIL PROTECTED]'
> Subject: Why tomcat NT service get killed when the user log off
>
> Please Help!!!
> This is for tomcat 3.2 beta 7 on Windows NT/2000. Tomcat is registed as
> an NT service using 'jk_nt_service.exe' (under Systemlocal account).
> It's starts fine but if I log off the windows, tomcat get killed which
> is not suppose to be. Could anybody tell me why this happen and how to
> fix it.
> -- Zhiping (ext: 307)




RE: Why tomcat NT service get killed when the user log off

2000-11-18 Thread Elijah Roberts

On Sunday November 19, 2000 Nacho wrote:
> Brett can you contributeyour solution to this problem tojakarta?? 
> 
> or at least send me thesources or binaries :-) is the better  more
> elegant solution to this problem i've seen, 
> 
> if you can contribute this i'll be glad to commit it to tomcat 3.3 and
> 4.0 
> 
> of course giving you credits as the rules mandate ;-)

Just in case anyone was curious, this bug was recently closed on Sun's
bug parade. Apparently in jdk1.3.1 there is a new flag (-rs maybe, I
can't remember exactly) that will disable shutting down of the JVM when
the logoff event is received. This will allow java.exe to function
properly when running as a service. Who knows when 1.3.1 will be
released, however.

Elijah Roberts
[EMAIL PROTECTED]



RE: Why tomcat NT service get killed when the user log off

2000-11-18 Thread Nacho

Brett can you contributeyour solution to this problem tojakarta?? 

or at least send me thesources or binaries :-) is the better  more
elegant solution to this problem i've seen, 

if you can contribute this i'll be glad to commit it to tomcat 3.3 and
4.0 

of course giving you credits as the rules mandate ;-)

Saludos ,
Ignacio J. Ortega

-Mensaje original-
De: Brett Bergquist [mailto:[EMAIL PROTECTED]]
Enviado el: jueves 16 de noviembre de 2000 1:01
Para: [EMAIL PROTECTED]
Asunto: RE: Why tomcat NT service get killed when the user log off


Zhiping, even though jk_nt_service is being used to launch Tomcat, there
is a bug in the Java 1.3 runtime under Windows that causes any java.exe
process to be terminated when the user logs off. The bug is that a
console control handler is setup inside of the java runtime that detects
the CTRL_LOGOFF_EVENT that is sent by Windows to each process when the
user logs off and the handler inside of Java 1.3 is terminating the
process when this occurs. This is the correct operation for a normal
application running but not the correct one for a service.

There is a couple of packages around, one being located at
http://www.kcmultimedia.com/javaserv another at
http://www.eworksmart.com/jnt that handle the CTRL_LOGOFF_EVENT. I tried
a couple of these and while I found that they indeed to stop the
application from being terminated by the CTRL_LOGOFF_EVENT, I found that
they interferred with the normal shutdown of Tomcat. That is, using
these packages, I was not able to shutdown Tomcat cleanly, which caused
the servlets to not have their "destroy" method invoked. 

The reason that this occurs is because the way that these packages work
is that they invoke the Java VM using the JNI interface. When Tomcat is
to be shutdown, the same JNI interface is used to invoke a shutdown
method. The problem occurs because the way that Tomcat (3.x) is shutdown
is by using the APJ interface to send the existing Tomcat instance a APJ
shutdown message (through a TCP connection in fact). These packages send
the APJ message using the JNI interface, but when call returns, they
assume that Tomcat is ready to be shutdown and they then tear down the
Java VM running the Tomcat process. In reality, the Tomcat process has
not yet received the APJ message through its socket interface and as
such has not shutdown cleanly and does not give the servlets a chance to
have their "destroy" method called.

Because my application needs to have the servlet's "destroy" method
called when Tomcat shuts down, I solved this problem by using the source
to "java.exe" launcher as a starting point and then modified it to
install a console control handler that ignores the CTRL_LOGOFF_EVENT. I
called this new launcher "javaex.exe". I then used jk_nt_service and
changed the configuration file references of "java.exe" to "javaex.exe".



I hope this helps.

-Original Message-
From: Zhiping Wei [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 15, 2000 5:38 PM
To: '[EMAIL PROTECTED]'
Subject: Why tomcat NT service get killed when the user log off



Please Help!!! 
This is for tomcat 3.2 beta 7 on Windows NT/2000. Tomcat is registed as
an NT service using 'jk_nt_service.exe' (under Systemlocal account).
It's starts fine but if I log off the windows, tomcat get killed which
is not suppose to be. Could anybody tell me why this happen and how to
fix it. 
-- Zhiping (ext: 307) 



RE: Why tomcat NT service get killed when the user log off

2000-11-15 Thread Brett Bergquist
Title: Why tomcat NT service get killed when the user log off



Zhiping, even though jk_nt_service is being used to 
launch Tomcat, there is a bug in the Java 1.3 runtime under Windows that causes 
any java.exe process to be terminated when the user logs off.  The bug is 
that a console control handler is setup inside of the java runtime that detects 
the CTRL_LOGOFF_EVENT that is sent by Windows to each process when the user logs 
off and the handler inside of Java 1.3 is terminating the process when this 
occurs.  This is the correct operation for a normal application running but 
not the correct one for a service.
 
There 
is a couple of packages around, one being located at http://www.kcmultimedia.com/javaserv 
another at http://www.eworksmart.com/jnt that 
handle the CTRL_LOGOFF_EVENT.  I tried a couple of these and while I found 
that they indeed to stop the application from being terminated by the 
CTRL_LOGOFF_EVENT, I found that they interferred with the normal shutdown of 
Tomcat.  That is, using these packages, I was not able to shutdown Tomcat 
cleanly, which caused the servlets to not have their "destroy" method 
invoked.  
 
The 
reason that this occurs is because the way that these packages work is that they 
invoke the Java VM using the JNI interface.   When Tomcat is to be 
shutdown, the same JNI interface is used to invoke a shutdown method.  The 
problem occurs because the way that Tomcat (3.x) is shutdown is by using the 
APJ  interface to send the existing Tomcat instance a APJ shutdown message 
(through a TCP connection in fact).  These packages send the APJ message 
using the JNI interface, but when call returns, they assume that Tomcat is ready 
to be shutdown and they then tear down the Java VM running the Tomcat 
process.  In reality, the Tomcat process has not yet received the APJ 
message through its socket interface and as such has not shutdown cleanly and 
does not give the servlets a chance to have their "destroy" method 
called.
 
Because my application needs to have the servlet's 
"destroy" method called when Tomcat shuts down,  I solved this 
problem by using the source to "java.exe" launcher as a starting point and then 
modified it to install a console control handler that ignores the 
CTRL_LOGOFF_EVENT.  I called this new launcher "javaex.exe".  I then 
used jk_nt_service and changed the configuration file references of "java.exe" 
to "javaex.exe".  
 
I hope 
this helps.
 

  -Original Message-From: Zhiping Wei 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, November 15, 2000 5:38 
  PMTo: '[EMAIL PROTECTED]'Subject: Why 
  tomcat NT service get killed when the user log off
  Please Help!!! 
  This is for tomcat 3.2 beta 7 on Windows 
  NT/2000. Tomcat is registed as an NT service using 'jk_nt_service.exe' (under 
  Systemlocal account). It's starts fine but if I log off the windows, tomcat 
  get killed which is not suppose to be. Could anybody tell me why this happen 
  and how to fix it. 
  -- Zhiping    (ext: 
  307) 


RE: Why tomcat NT service get killed when the user log off

2000-11-15 Thread Jacob Kjome
Title: Why tomcat NT service get killed when the user log off



Make 
sure you search the archives before you send a question like this again.  
It has been answered a hundred times or more.
 
One 
more time,
 
The 
problem is not with Tomcat, it is something inherent to JDK 1.3 from Sun.  
It is a known bug that Sun hasn't fixed yet.  If you want to avoid this, 
use JDK 1.2.2 or use a alternate java service utility, such as javaservice 
(  http://www.alexandriasc.com/software/JavaService/  
).
 
Here 
are the Archive links:
 

Searchable Email Archive 
http://marc.theaimsgroup.com/?l=tomcat-user&r=1&w=2
http://www.metronet.com/~wjm/tomcat/
http://archives.real-time.com/rte-tomcat/
http://mikal.org/interests/java/tomcat/index.html
 
Jake

  -Original Message-From: Zhiping Wei 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, November 15, 2000 4:38 
  PMTo: '[EMAIL PROTECTED]'Subject: Why 
  tomcat NT service get killed when the user log off
  Please Help!!! 
  This is for tomcat 3.2 beta 7 on Windows 
  NT/2000. Tomcat is registed as an NT service using 'jk_nt_service.exe' (under 
  Systemlocal account). It's starts fine but if I log off the windows, tomcat 
  get killed which is not suppose to be. Could anybody tell me why this happen 
  and how to fix it. 
  -- Zhiping    (ext: 
  307)