Hi Mike,

I did not get an answer.  This happens on both Win32 (windows XP) and
Redhat Linux 7.2 and Advanced Server 2.1.  The target platform is Advanced
Server.

In my run() method I have wrapped everything in a try/finally block, and
in the finally block I close the client socket, and perform database
connection cleanup.  I am just getting a connection from a pool, so I just
release the connection back into the pool.  But your suggestion is
interesting, since for some reason hitting the socket with another client
call AFTER trying to shut it down causes it to blow up (and eventually
shut down), it might be that it is holding on to something but I thought
that was the point of a finally - it makes sure the code inside it is run.

After shutting down tomcat and then hitting the port, this is the output
in tomcats log:

==========  Begin Log ==============
2003-01-28 10:57:22 [org.apache.catalina.connector.warp.WarpConnector]
Error accepting requests
java.net.SocketException: socket closed
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:430)
        at java.net.ServerSocket.implAccept(ServerSocket.java:255)
        at java.net.ServerSocket.accept(ServerSocket.java:234)
        at
org.apache.catalina.connector.warp.WarpConnector.run(WarpConnector.java:590)
        at java.lang.Thread.run(Thread.java:498)
==========  End Log ==============

The error report for linux is much longer:

==========  Begin Log ==============
Stopping service Tomcat-Standalone
Stopping service Tomcat-Apache

Unexpected Signal : 11 occurred at PC=0x402CF9A1
Function=(null)+0x402CF9A1
Library=/usr/java/j2sdk1.4.0_01/jre/lib/i386/client/libjvm.so

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:343)
        - locked <0x447835b0> (a java.net.PlainSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:438)
        at java.net.ServerSocket.accept(ServerSocket.java:409)
        at com.oreilly.servlet.Daemon.run(DaemonHttpServlet.java:125)

Dynamic libraries:
08048000-0804d000 r-xp 00000000 08:05 17865
/usr/java/j2sdk1.4.0_01/bin/java
0804d000-0804e000 rw-p 00004000 08:05 17865
/usr/java/j2sdk1.4.0_01/bin/java
40000000-40016000 r-xp 00000000 08:0a 15974      /lib/ld-2.2.4.so
40016000-40017000 rw-p 00015000 08:0a 15974      /lib/ld-2.2.4.so
40017000-40020000 r-xp 00000000 08:05 418925
/usr/java/j2sdk1.4.0_01/jre/lib/i386/native_threads/libhpi.so
40020000-40021000 rw-p 00008000 08:05 418925
/usr/java/j2sdk1.4.0_01/jre/lib/i386/native_threads/libhpi.so
40021000-40022000 r--p 00000000 08:05 128276
/usr/lib/locale/en_US/LC_IDENTIFICATION
40022000-40023000 r--p 00000000 08:05 256565
/usr/lib/locale/en_US/LC_MEASUREMENT
40023000-40024000 r--p 00000000 08:05 192451
/usr/lib/locale/en_US/LC_TELEPHONE
40024000-40025000 r--p 00000000 08:05 192453
/usr/lib/locale/en_US/LC_ADDRESS
40026000-40033000 r-xp 00000000 08:0a 47914 /lib/i686/libpthread-0.9.so
40033000-4003b000 rw-p 0000c000 08:0a 47914 /lib/i686/libpthread-0.9.so
4003b000-4003e000 r-xp 00000000 08:0a 15987      /lib/libdl-2.2.4.so
4003e000-4003f000 rw-p 00002000 08:0a 15987      /lib/libdl-2.2.4.so
4003f000-40171000 r-xp 00000000 08:0a 47910      /lib/i686/libc-2.2.4.so
40171000-40176000 rw-p 00131000 08:0a 47910      /lib/i686/libc-2.2.4.so
4017a000-40440000 r-xp 00000000 08:05 274639
/usr/java/j2sdk1.4.0_01/jre/lib/i386/client/libjvm.so
40440000-405a9000 rw-p 002c5000 08:05 274639
/usr/java/j2sdk1.4.0_01/jre/lib/i386/client/libjvm.so
405bd000-405d0000 r-xp 00000000 08:0a 15992      /lib/libnsl-2.2.4.so
405d0000-405d1000 rw-p 00012000 08:0a 15992      /lib/libnsl-2.2.4.so
405d3000-40607000 r-xp 00000000 08:05 96751
/usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
40607000-40613000 rw-p 00033000 08:05 96751
/usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
40615000-40637000 r-xp 00000000 08:0a 47912      /lib/i686/libm-2.2.4.so
40637000-40638000 rw-p 00021000 08:0a 47912      /lib/i686/libm-2.2.4.so
40638000-40649000 r-xp 00000000 08:05 50212
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libverify.so
40649000-4064b000 rw-p 00010000 08:05 50212
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libverify.so
4064b000-4066d000 r-xp 00000000 08:05 50200
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libjava.so
4066d000-4066f000 rw-p 00021000 08:05 50200
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libjava.so
40671000-40685000 r-xp 00000000 08:05 50213
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libzip.so
40685000-40688000 rw-p 00013000 08:05 50213
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libzip.so
40688000-41d05000 r--s 00000000 08:05 226557
/usr/java/j2sdk1.4.0_01/jre/lib/rt.jar
41d47000-41d5e000 r--s 00000000 08:05 226558
/usr/java/j2sdk1.4.0_01/jre/lib/sunrsasign.jar
41d5e000-41dcc000 r--s 00000000 08:05 226551
/usr/java/j2sdk1.4.0_01/jre/lib/jsse.jar
41dcc000-41ddf000 r--s 00000000 08:05 226550
/usr/java/j2sdk1.4.0_01/jre/lib/jce.jar
41ddf000-42060000 r--s 00000000 08:05 226539
/usr/java/j2sdk1.4.0_01/jre/lib/charsets.jar
44108000-44109000 r--p 00000000 08:05 192452 /usr/lib/locale/en_US/LC_NAME
44109000-4410a000 r--p 00000000 08:05 384840
/usr/lib/locale/en_US/LC_PAPER
4410a000-4410b000 r--p 00000000 08:05 144508
/usr/lib/locale/en_US/LC_MESSAGES/SYS_LC_MESSAGES
4410b000-4410c000 r--p 00000000 08:05 256564
/usr/lib/locale/en_US/LC_MONETARY
4410c000-4410d000 r--p 00000000 08:05 128277 /usr/lib/locale/en_US/LC_TIME
4410d000-4410e000 r--p 00000000 08:05 64234
/usr/lib/locale/en_US/LC_NUMERIC
4410e000-44110000 r--s 00000000 08:05 17955
/usr/java/j2sdk1.4.0_01/jre/lib/ext/dnsns.jar
4c313000-4c33e000 r--p 00000000 08:05 64243 /usr/lib/locale/en_US/LC_CTYPE
4c33e000-4c344000 r--p 00000000 08:05 208583
/usr/lib/locale/en_US/LC_COLLATE
4c344000-4c352000 r--s 00000000 08:05 17956
/usr/java/j2sdk1.4.0_01/jre/lib/ext/ldapsec.jar
4c352000-4c35c000 r-xp 00000000 08:0a 16008 /lib/libnss_files-2.2.4.so
4c35c000-4c35d000 rw-p 00009000 08:0a 16008 /lib/libnss_files-2.2.4.so
4c58c000-4c62f000 r--s 00000000 08:05 17957
/usr/java/j2sdk1.4.0_01/jre/lib/ext/localedata.jar
4c62f000-4c64c000 r--s 00000000 08:05 17958
/usr/java/j2sdk1.4.0_01/jre/lib/ext/sunjce_provider.jar
4c64c000-4cae6000 r--s 00000000 08:05 290686
/usr/java/j2sdk1.4.0_01/lib/tools.jar
4cae6000-4caec000 r--s 00000000 08:06 192431
/var/tomcat4/bin/bootstrap.jar
4caec000-4caf4000 r--s 00000000 08:06 224477
/var/tomcat4/common/lib/naming-resources.jar
4caf4000-4cafa000 r--s 00000000 08:06 224476
/var/tomcat4/common/lib/naming-common.jar
4cafa000-4cb0d000 r--s 00000000 08:05 290366
/usr/share/java/servlet-2.3-4.0.3.jar
4cb0d000-4cc8d000 r--s 00000000 08:05 290394
/usr/share/java/xerces-1.4.4.jar
4cc8d000-4cd0b000 r--s 00000000 08:06 128295
/var/tomcat4/server/lib/catalina.jar
4cd0b000-4cd0f000 r--s 00000000 08:06 128298
/var/tomcat4/server/lib/servlets-default.jar
4cd0f000-4cd10000 r--s 00000000 08:06 128297
/var/tomcat4/server/lib/servlets-common.jar
4cd10000-4cd12000 r--s 00000000 08:06 128299
/var/tomcat4/server/lib/servlets-invoker.jar
4cd12000-4cd15000 r--s 00000000 08:06 128300
/var/tomcat4/server/lib/servlets-manager.jar
4cd15000-4cd17000 r--s 00000000 08:06 128301
/var/tomcat4/server/lib/servlets-snoop.jar
4cd17000-4cd1e000 r--s 00000000 08:05 290370
/usr/share/java/jakarta-regexp-1.2.jar
4cd1e000-4cd23000 r--s 00000000 08:06 128303
/var/tomcat4/server/lib/servlets-webdav.jar
4cd23000-4cd32000 r--s 00000000 08:06 128304
/var/tomcat4/server/lib/tomcat-ajp.jar
4cd32000-4cd4d000 r--s 00000000 08:06 128305
/var/tomcat4/server/lib/tomcat-util.jar
4cd4d000-4cd54000 r--s 00000000 08:06 128306
/var/tomcat4/server/lib/warp.jar
4cd54000-4cd66000 r-xp 00000000 08:05 50209
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libnet.so
4cd66000-4cd67000 rw-p 00011000 08:05 50209
/usr/java/j2sdk1.4.0_01/jre/lib/i386/libnet.so
4cde8000-4ce15000 r--s 00000000 08:06 48133
/var/tomcat4/lib/jasper-compiler.jar
4ce15000-4ce24000 r--s 00000000 08:06 48134
/var/tomcat4/lib/jasper-runtime.jar
4ce24000-4ce26000 r--s 00000000 08:06 48135
/var/tomcat4/lib/naming-factory.jar
4cf28000-4cf29000 r--s 00000000 08:06 160364
/var/tomcat4/temp/jar_cache63125.tmp (deleted)
4cf29000-4cf2a000 r--s 00000000 08:06 160365
/var/tomcat4/temp/jar_cache63126.tmp (deleted)
4d0cc000-4d1d7000 r--s 00000000 08:06 80292
/var/tomcat4/webapps/netman/WEB-INF/lib/classes12.jar
4d275000-4d27b000 r--s 00000000 08:06 160448
/var/tomcat4/temp/jar_cache63127.tmp (deleted)
4d27b000-4d294000 r--s 00000000 08:06 160449
/var/tomcat4/temp/jar_cache63128.tmp (deleted)
4d294000-4d39f000 r--s 00000000 08:06 160451
/var/tomcat4/temp/jar_cache63129.tmp (deleted)
4d39f000-4d3ab000 r--s 00000000 08:06 160455
/var/tomcat4/temp/jar_cache63130.tmp (deleted)
4d3ab000-4d3bc000 r--s 00000000 08:06 160456
/var/tomcat4/temp/jar_cache63131.tmp (deleted)

Local Time = Tue Jan 28 11:02:16 2003
Elapsed Time = 1260939
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002D5
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.0_01-b03 mixed mode)
==========  End Log ==============

This is all greek to me.  If you or anyone else can shed light on this I
would be grateful.

Thanks,

Chuck





Mike McGuinness <[EMAIL PROTECTED]>
Sent by: "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology." <[EMAIL PROTECTED]>
01/28/2003 10:45 AM
Please respond to "A mailing list for discussion about Sun Microsystem's
Java               Servlet API Technology."


        To:     [EMAIL PROTECTED]
        cc:
        Subject:        Re: Problems with DaemonHttpServlet not shutting down


Did you get an answer? If not, what OS are you using? Also, you should
clean up any network or database resources before calling destroy, that
may help.

Mike

On Fri, 2003-01-10 at 09:20, Chuck Hirstius wrote:
Hello all,

I am running tomcat 4.0.3 (on windows and linux) and using the
com.oreilly.servlets class DaemonHttpServlet to provide socket based
connections to legacy clients.  I basically built right off the example in
the O'Reilly servlets book and everything works fine.  Fine, that is,
until I try to shut down Tomcat.  The threads attached to the Daemon
servlet just don't go away.  However if I hit them with the legacy client
(causing it to get a connection exception on the socket) the servlet shuts
down, although with some really nasty error messages in the tomcat log.

Has anyone else seen this behavior?  Is there some simple "gotcha" that I
missed?  In my destroy() method I am calling super.destroy() and it is the
very first thing I call in that method.  Is there something else I should
be doing or checking so that it shuts down cleanly?  I can post more
details, including code samples and log output if anyone thinks it will
help.

Thanks,

Chuck

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to