If you are receiving messages synchronously (using a consumer) and the server is shutdown, the client still waiting for a message and does not throw any exception (neither returns null)
MessageConsumer receiver = session.createConsumer(destination);
connection.start();
TextMessage message = (TextMessage) receiver.receive();
If you register an ExceptionListener you realize that an exception is thrown from org.exolab.jms.client.net.JmsServerStubImpl.disconnected(Caller) but it does not have any error code. So, the JmsConnection won't be closed (because it expects JmsErrorCodes.CONNECTION_TO_SERVER_DROPPED as error code).
IMHO, JmsServerStubImpl.disconnected(Caller) should be:
public void disconnected(Caller caller) {
if (_listener != null) {
_listener.onException(new JMSException("Lost connection", JmsErrorCodes.CONNECTION_TO_SERVER_DROPPED));
}
}
thread dump