tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arieh Markel <Arieh.Mar...@Central.Sun.COM>
Subject Re: Question: how to stop when RMI registry not available ?
Date Wed, 09 Feb 2000 00:34:04 GMT
Further investigation of the source indicates that the
TcpEndpoint.stop() method does not close the server socket.

There is a comment on it XXX ?

---
I proceeded to uncomment the serverSocket.close() and it accomplished
what I wanted.

However, exceptions were thrown on the 'serverSocket.close()'.


Stopping context manager 
java.net.SocketException: Socket closed
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:406)
        at java.net.ServerSocket.implAccept(ServerSocket.java:241)
        at java.net.ServerSocket.accept(ServerSocket.java:224)
        at 
org.apache.tomcat.service.TcpEndpoint.acceptConnections(TcpEndpoint.java:254)
        at org.apache.tomcat.service.TcpListenerThread.run(TcpEndpoint.java:293)
        at java.lang.Thread.run(Thread.java:485)
Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] shutdown due 
to exception: java.net.SocketException: Socket closed
Taking down context: /services
Context(/services): default: destroy
Context: Ctx(/services) down
Taking down context: 
Context(): default: destroy
Context: Ctx() down


This appears to be because of a lack of synchronization between the
closing of the serverSocket on stop() and the acceptConnections() method
which performs a serverSocket.accept() at the time that the socket has been
closed.

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)


Mime
View raw message