book
Article ID: KB0088872
calendar_today
Updated On:
Description
Resolution:
Description:
============
Sometimes a client application throws the exception "javax.jms.IllegalStateException: Connection is closed".
Causes:
============
The exception is thrown when the client application tries to send or receive on a connection that is already terminated.
We have seen this error in the following situations:
1). The client application is multi-threaded. For example, the same connection is used in two threads to connect to EMS server. At some point in time the connection is closed in one of the threads. If the program still tries to send/receive message to/from EMS server in the other thread, the exception is thrown. This is an application error.
2). If the following parameters is configured in the EMS server log:
---------------
client_heartbeat_server =
server_timeout_client_connection =
server_heartbeat_client =
client_timeout_server_connection =
--------------
When the EMS server does not receive heartbeats from the client within server_timeout_client_connection, it disconnects the client. If the client tries to use this connection, the exception is thrown.
You will notice the following message in the EMS server log (if CONNECT is included in log_trace):
Disconnected, connection id=xxx, reason: closed by server due to timeout.
3). A network related issue.
Resolution:
============
As this is an application error, you will need to troubleshoot the application.
If the exception is due to a timeout, we recommend that you do testing in your environment and increase the server_timeout_client_connection accordingly.
If you need further help, enable tracing like the following in EMS server:
1). Set server log_trace=DEFAULT,+CONNECT,+PRODCONS
set server client_trace=enabled
2). Reproduce the issue and collect the TCPdump raw packets which cover the problem period for TIBCO Support to review.
3). Send Tibco Support the EMS server log, application log and stdout/stderr output (which includes the EMS client trace log messages).
Environment:
===========
All
Issue/Introduction
What is the cause of the exception "javax.jms.IllegalStateException: Connection is closed"?